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:
And this query works correctly:
But this query finds ONLY Published posts:
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).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.