WP_List_Table::display_tablenav() WordPress Method

The WP_List_Table::display_tablenav() method is used to display the table navigation controls at the top and bottom of the list table. The method takes two arguments: $which (string) (required) Which tablenav to display. Valid values are 'top' or 'bottom'. $args (array) (optional) Default array. The display_tablenav() method is called by the display() method when the list table is being displayed. The $which argument is used to determine which set of navigation controls to display. The $args array is used to pass additional arguments to the display_tablenav() method.

WP_List_Table::display_tablenav( string $which ) #

Generates the table navigation above or below the table


Parameters

$which

(string)(Required)


Top ↑

More Information

This generates the table navigation above or below the table. Generally, you don’t need to call this explicitly as it is handled in the display() method.


Top ↑

Source

File: wp-admin/includes/class-wp-list-table.php

	protected function display_tablenav( $which ) {
		if ( 'top' === $which ) {
			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
		}
		?>
	<div class="tablenav <?php echo esc_attr( $which ); ?>">

		<?php if ( $this->has_items() ) : ?>
		<div class="alignleft actions bulkactions">
			<?php $this->bulk_actions( $which ); ?>
		</div>
			<?php
		endif;
		$this->extra_tablenav( $which );
		$this->pagination( $which );
		?>

		<br class="clear" />
	</div>
		<?php
	}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.