On this page
WP_List_Table::get_pagenum(): int
Gets the current page number.
Return
int
Source
File: wp-admin/includes/class-wp-list-table.php. View all references
public function get_pagenum() {
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {
$pagenum = $this->_pagination_args['total_pages'];
}
return max( 1, $pagenum );
}
Related
Uses
| Uses | Description |
|---|---|
| absint() wp-includes/functions.php | Converts a value to non-negative integer. |
Used By
| Used By | Description |
|---|---|
| WP_List_Table::pagination() wp-admin/includes/class-wp-list-table.php | Displays the pagination. |
| WP_List_Table::set_pagination_args() wp-admin/includes/class-wp-list-table.php | An internal method that sets all the necessary pagination arguments |
| WP_List_Table::get_pagination_arg() wp-admin/includes/class-wp-list-table.php | Access the pagination args. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_list_table/get_pagenum