Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
    
register_post_status is not! meant to be used by themes or plugins. I wrote a pretty intense plugin to work around that fact, but anyway: It's not that simple and you will simply have to drop the idea of custom post status. Search through my answers to read more about it. –  kaiser Oct 9 '12 at 18:58
    
What exactly do you mean!? I've already incorperate custom stati in my plugin and have no problems. You have to many answers to look through. Any specific one? –  revaxarts Oct 9 '12 at 19:07
    
You will have to search on your own, but to sum it up: The post status is hard coded in lots of cases in core and even when this works in some cases, it will simply crash in others. Believe me: I digged a lot in core and you'll be surprised, where the post status is used. And you're missing lots of cases when just throwing and additional status in. Hint: The post status API is not finalized since WP 3.0 - you can see this in the incomplete phpDocBlocks and read on wp-hackers about it. –  kaiser Oct 9 '12 at 19:28
    
Yes I found them missing in the quick edit section for instance and on some other places. I did some workaround in two or three cases so should not a big deal to "fix" this on later version –  revaxarts Oct 9 '12 at 19:43
    
Do whatever you want, I already stated that you'll run into problems - incl. the fact that the API is already started and will be finished with some version. Prepare to hit the wall ;) ... and rebuild everything (incl. fixing everything in your DB) with a future version. –  kaiser Oct 9 '12 at 20:05
add comment

1 Answer

up vote 2 down vote accepted

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.