WP_List_Table::get_pagination_arg() WordPress Method

The WP_List_Table::get_pagination_arg() method allows you to get the current pagination argument for a given list table. This is useful if you need to make a custom pagination function for your list table.

WP_List_Table::get_pagination_arg( string $key ) #

Access the pagination args.


Parameters

$key

(string)(Required)Pagination argument to retrieve. Common values include 'total_items', 'total_pages', 'per_page', or 'infinite_scroll'.


Top ↑

Return

(int) Number of items that correspond to the given pagination argument.


Top ↑

Source

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

	public function get_pagination_arg( $key ) {
		if ( 'page' === $key ) {
			return $this->get_pagenum();
		}

		if ( isset( $this->_pagination_args[ $key ] ) ) {
			return $this->_pagination_args[ $key ];
		}

		return 0;
	}


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.