Privacy: Enable pagination screen options for privacy requests list tables.

Props birgire, pbiron.
Fixes #44025.
Built from https://develop.svn.wordpress.org/trunk@43486


git-svn-id: http://core.svn.wordpress.org/trunk@43313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-07-17 16:04:24 +00:00
parent 01d8979bee
commit 172aa4aa3e
4 changed files with 19 additions and 2 deletions

View File

@ -47,6 +47,8 @@ add_action( 'admin_head', '_ipad_meta' );
// Privacy tools
add_action( 'admin_menu', '_wp_privacy_hook_requests_page' );
add_action( 'load-tools_page_export_personal_data', '_wp_privacy_requests_screen_options' );
add_action( 'load-tools_page_remove_personal_data', '_wp_privacy_requests_screen_options' );
// Prerendering.
if ( ! is_customize_preview() ) {

View File

@ -619,6 +619,8 @@ function set_screen_options() {
case 'upload_per_page':
case 'edit_tags_per_page':
case 'plugins_per_page':
case 'export_personal_data_requests_per_page':
case 'remove_personal_data_requests_per_page':
// Network admin
case 'sites_network_per_page':
case 'users_network_per_page':

View File

@ -1005,6 +1005,19 @@ function _wp_privacy_hook_requests_page() {
add_submenu_page( 'tools.php', __( 'Erase Personal Data' ), __( 'Erase Personal Data' ), 'erase_others_personal_data', 'remove_personal_data', '_wp_personal_data_removal_page' );
}
/**
* Add options for the privacy requests screens.
*
* @since 4.9.8
* @access private
*/
function _wp_privacy_requests_screen_options() {
$args = array(
'option' => str_replace( 'tools_page_', '', get_current_screen()->id ) . '_requests_per_page',
);
add_screen_option( 'per_page', $args );
}
// TODO: move the following classes in new files.
if ( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
@ -1222,7 +1235,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
);
$this->items = array();
$posts_per_page = 20;
$posts_per_page = $this->get_items_per_page( $this->request_type . '_requests_per_page' );
$args = array(
'post_type' => $this->post_type,
'post_name__in' => array( $this->request_type ),

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43480';
$wp_version = '5.0-alpha-43486';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.