事实证明,您可以使用此筛选器更改post\\u状态链接的优先级:
https://github.com/WordPress/WordPress/blob/5c6b63d3a6874743542d6cede307c98ee370af23/wp-admin/includes/class-wp-list-table.php#L378
$views = apply_filters( "views_{$this->screen->id}", $views );
如果您的自定义帖子类型为“入站电子邮件”,则应用的筛选器将如下所示:
add_filter( \'views_edit-inbound-email\' , \'function_to_filter_priority\' );
/**
* rebuild priority of post status links
* @param ARRAY $links
* @return ARRAY $new_links
*/
function function_to_filter_priority( $links ) {
$new_links[\'all\'] = $links[\'all\'];
if (isset($links[\'draft\'])) {
$new_links[\'draft\'] = $links[\'draft\'];
}
if (isset($links[\'pending\'])) {
$new_links[\'pending\'] = $links[\'pending\'];
}
if (isset($links[\'sent\'])) {
$new_links[\'sent\'] = $links[\'sent\'];
}
if (isset($links[\'automated\'])) {
$new_links[\'automated\'] = $links[\'automated\'];
}
if (isset($links[\'trash\'])) {
$new_links[\'trash\'] = $links[\'trash\'];
}
return $new_links;
}