On Admin > Edit Posts (edit.php), how can I filter for a Custom Taxonomy and see posts of ANY status, not just Published?
For example, say I have a Custom Taxonomy "Color"...
These queries find posts of ANY status:
- edit.php?category_name=foo
- edit.php?author=3
- edit.php?tag=foo
And this query works correctly:
- edit.php?color=red&post开发者_开发问答_status=draft
But this query finds ONLY Published posts:
- edit.php?color=red
Drop this in a plugin or your theme's functions.php
;
if (is_admin()):
function my_query_parser(&$query)
{
if (!isset($_GET['post_status']))
$query->query_vars['post_status'] = 'any';
}
add_action('parse_query', 'my_query_parser');
endif;
Personally I would class this as a bug in WP, I'll post it up in trac.
UPDATE:
It seems this trac entry mentions the issue, and it's reportedly fixed (probably in the nightly build).
精彩评论