admin管理员组

文章数量:1122846

I have the following code where the "private" value is set to true but posts with this status show up on the front end. In the admin add/edit screen the post shows "Visibility" as "Public".

function needs_video_status(){
    register_post_status( 'needs-video', array(
        'label'                     => _x( 'Draft - Needs Video', 'post' ),
        'public'                    => false,
        'private'                   => true,
        'exclude_from_search'       => true,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'Draft - Needs Video <span class="count">(%s)</span>', 'Draft - Needs Video <span class="count">(%s)</span>' ),
    ) );
}
add_action( 'init', 'needs_video_status' );

Is it even possible to have a custom post status set to private visibility? Alternatively, is there a way to set a custom post status as a draft?

本文标签: How can I make a custom post status private or draft