这个技巧应该可以帮助你。。。
<?php
add_action(\'pre_get_posts\', \'filter_posts_list\');
function filter_posts_list($query)
{
//$pagenow holds the name of the current page being viewed
global $pagenow;
$post_type = $query->get(\'post_type\');
//Check the post type and whether its the list page, then set the taxonomy
if($post_type == \'my_cpt\' && \'edit.php\' == $pagenow)
{
//global $query\'s set() method for setting the taxonomy
$query->set(\'my_taxonomy\', \'my_taxonomy_value\');
}
}
?>
您可以将任何WP\\U查询参数用于
set
方法修改此解决方案。如需详细说明,
hit this.