I have added a custom post status and it is showing in the backend, but I can not select it using "Set this post status" in any of my forms.
// Registering custom post status
function wpb_custom_post_status(){
register_post_status('rejected', array(
'label' => _x( 'Rejected', 'post', 'vendor', 'recipe', 'restaurant' , 'vendor-photo' , 'vendor-video' ),
'public' => true,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'_builtin' => true, /* internal use only. */
'label_count' => _n_noop( 'Rejected <span class="count">(%s)</span>', 'Rejected <span class="count">(%s)</span>' ),
) );
}
add_action( 'init', 'wpb_custom_post_status' );
// Using jQuery to add it to post status dropdown
add_action('admin_footer-post.php', 'wpb_append_post_status_list');
function wpb_append_post_status_list(){
global $post;
$complete = '';
$label = '';
if($post->post_type == 'post'||'vendor'||'recipe'||'restaurant'||'vendor-photo'||'vendor-video'){
if($post->post_status == 'rejected'){
$complete = ' selected="selected"';
$label = '<span id="post-status-display">Rejected</span>';
}
echo '
<script>
jQuery(document).ready(function($){
$("select#post_status").append("<option value=\"rejected\" '.$complete.'>Rejected</option>");
$(".misc-pub-section label").append("'.$label.'");
});
</script>
';
}
}
OK just figured it out should not have had: '_builtin' => true, /* internal use only. */