You appear to be a bot. Output may be restricted
Description
An internal method that sets all the necessary pagination arguments
Usage
BW_List_Table::set_pagination_args( $args );
Parameters
- $args
- ( array ) required – An associative array with information about the pagination
- $args
- ( array|string ) required –
Returns
voidSource
File name: oik/admin/class-bw-list-table.phpLines:
1 to 18 of 18
protected function set_pagination_args( $args ) { $args = wp_parse_args( $args, array( 'total_items' => 0, 'total_pages' => 0, 'per_page' => 0, ) ); if ( !$args['total_pages'] && $args['per_page'] > 0 ) $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] ); // Redirect if page number is invalid and headers are not already sent. if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) { wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) ); exit; } $this->_pagination_args = $args; }View on GitHub View on Trac