WordPress at a glance
function is not described

WP_Media_List_Table::views() WP 1.0

Override parent views so we can use the filter bar display.

This is a method of the class: WP_Media_List_Table

Hooks from the method
Return

Null. Nothing.

Usage

$WP_Media_List_Table = new WP_Media_List_Table();
$var = $WP_Media_List_Table->views();

Notes

  • Global. String. $mode List table view mode.

Code of WP Media List Table::views: wp-admin/includes/class-wp-media-list-table.php WP 5.2.2

<?php
public function views() {
	global $mode;

	$views = $this->get_views();

	$this->screen->render_screen_reader_content( 'heading_views' );
	?>
<div class="wp-filter">
<div class="filter-items">
	<?php $this->view_switcher( $mode ); ?>

	<label for="attachment-filter" class="screen-reader-text"><?php _e( 'Filter by type' ); ?></label>
	<select class="attachment-filters" name="attachment-filter" id="attachment-filter">
		<?php
		if ( ! empty( $views ) ) {
			foreach ( $views as $class => $view ) {
				echo "\t$view\n";
			}
		}
		?>
	</select>

	<?php
	$this->extra_tablenav( 'bar' );

	/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
	$views = apply_filters( "views_{$this->screen->id}", array() );

	// Back compat for pre-4.0 view links.
	if ( ! empty( $views ) ) {
		echo '<ul class="filter-links">';
		foreach ( $views as $class => $view ) {
			echo "<li class='$class'>$view</li>";
		}
		echo '</ul>';
	}
	?>
</div>

<div class="search-form">
	<label for="media-search-input" class="screen-reader-text"><?php esc_html_e( 'Search Media' ); ?></label>
	<input type="search" placeholder="<?php esc_attr_e( 'Search media items...' ); ?>" id="media-search-input" class="search" name="s" value="<?php _admin_search_query(); ?>"></div>
</div>
	<?php
}