[wp-hackers] Incorrect documentation for register_post_status
Nikola Nikolov
nikolov.tmw at gmail.com
Fri Jul 4 13:38:27 UTC 2014
I had to add a new custom post status and so I looked-up the documentation
for the register_post_status()
<http://codex.wordpress.org/Function_Reference/register_post_status>
function and adjusted the sample code from there.
I found a way to add the post status to the status drop-down on the
add/edit posts screens and changed the status of one of the posts.
It all worked as expected - the post status was now updated for that post.
Then I went back to the posts screen for my custom post type and I saw the
post status link on top, showing me that there's 1 post with that post
status. That's also correct.
However the post disappeared from the list of posts, even though I've set
"show_in_admin_all_list" to true in the arguments for the post status.
So I looked around and found out that in /wp-includes/query.php on line
#2819
<https://github.com/WordPress/WordPress/blob/3.9-branch/wp-includes/query.php#L2819>
,
WordPress is getting registered post statuses with show_in_admin_all_list =
true AND protected = true
The *protected* argument is not documented anywhere, but after I set that
to true in my arguments list, the post appeared again.
I would go in and document that myself, but I really have no clue what
*protected* is used for and I don't want to advise people to add it in just
because it works.
If anyone has more insight, I'd be happy to hear it.
Nikola
More information about the wp-hackers
mailing list