您可以尝试在WP_List_Table
类别:
/**
* Filter the list of available list table views.
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen, usually a string.
*
* @since 3.5.0
*
* @param array $views An array of available list table views.
*/
$views = apply_filters( "views_{$this->screen->id}", $views );
示例edit-post
屏幕,过滤器为views_edit-post
:
/**
* Display HTML after the \'Posts\' title
* where we target the \'edit-post\' screen
*/
add_filter( \'views_edit-post\', function( $views )
{
echo \'<p>Greetings from <strong>views_edit-post</strong></p>\';
return $views;
} );
这将显示为:
