I noticed that the Piklist Demos content type uses custom post statuses.
,'post_states' => true
,'status' => array(
'draft' => array(
'label' => 'New'
,'public' => true
)
,'demo' => array(
'label' => 'Demo'
,'public' => true
)
,'lock' => array(
'label' => 'Lock'
,'public' => true
)
)
Two issues here:
1. when viewing all posts in the admin, they all show a status of “Draft” regardless of the chosen status type.
2. Permalinks don’t work, even if I flush rewrites.
Once I removed the above snippet everything worked fine.
I also added a snippet in my CPT plugin to flush rewrite rules.
// Flush rewrite rules for custom post types
add_action( 'after_switch_theme', 'do_flush_rewrite_rules' );
// Flush your rewrite rules
function do_flush_rewrite_rules() {
flush_rewrite_rules();
}