From d954d6213aa894d88231dfd65b7d13465d4b0258 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 17 Jul 2018 16:08:26 +0000 Subject: [PATCH] Privacy: Enable pagination screen options for privacy requests list tables. Props birgire, pbiron. Merges [43486] to the 4.9 branch. Fixes #44025. Built from https://develop.svn.wordpress.org/branches/4.9@43487 git-svn-id: http://core.svn.wordpress.org/branches/4.9@43314 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/admin-filters.php | 2 ++ wp-admin/includes/misc.php | 2 ++ wp-admin/includes/user.php | 15 ++++++++++++++- wp-includes/version.php | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/admin-filters.php b/wp-admin/includes/admin-filters.php index 2f70dad498..ba2cb7e2bd 100644 --- a/wp-admin/includes/admin-filters.php +++ b/wp-admin/includes/admin-filters.php @@ -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() ) { diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index ae4b32cc2c..969abc7a58 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -606,6 +606,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': diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index b1750da25c..7766dedc11 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -964,6 +964,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' ); @@ -1181,7 +1194,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 ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 5dbdf2ecf5..2eaf7e464f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.8-alpha-43485'; +$wp_version = '4.9.8-alpha-43487'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.