I have a custom post status which should be public visible but not displayed in the “all” list of the edit screen.

This is how I register the post status:

register_post_status('my_custom_post_status', array(
    'label' => __('The Label', 'domain'),
    'public' => true,
    'exclude_from_search' => true,
    'show_in_admin_all_list' => false,
    'label_count' => //blablabla
));

The show_in_admin_all_list = false should hide the status in the all-list but it doesn’t. Only if I set the public to false it is not visible. But I need public = true!

Any ideas

Codex: http://codex.wordpress.org/Function_Reference/register_post_status

4 s
4

This solves my problem:

register_post_status('my_custom_post_status', array(
    'label' => __('The Label', 'domain'),
    'public' => !is_admin(),
    'exclude_from_search' => true,
    'show_in_admin_all_list' => false,
    'label_count' => //blablabla
));

!is_admin() makes the status only public on the frontpage.

If you find a better solution please post it here!

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *