WP_List_Table::views()

In this article

Displays the list of views available on this table.

More Information

It renders out the <ul> element that contains the view names.

Source

public function views() {
	$views = $this->get_views();
	/**
	 * Filters 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.
	 *
	 * @since 3.1.0
	 *
	 * @param string[] $views An array of available list table views.
	 */
	$views = apply_filters( "views_{$this->screen->id}", $views );

	if ( empty( $views ) ) {
		return;
	}

	$this->screen->render_screen_reader_content( 'heading_views' );

	echo "<ul class='subsubsub'>\n";
	foreach ( $views as $class => $view ) {
		$views[ $class ] = "\t<li class='$class'>$view";
	}
	echo implode( " |</li>\n", $views ) . "</li>\n";
	echo '</ul>';
}

Hooks

apply_filters( “views_{$this->screen->id}”, string[] $views )

Filters the list of available list table views.

Changelog

VersionDescription
3.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.