Add content in custom post type page after the title and before columns

You could try to “hijack” the following filter in the WP_List_Table class:

/**
 * 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 );

Example

For the edit-post screen, the filter is 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;
} );

and this will display as:

greetings

Leave a Comment