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
This commit is contained in:
Sergey Biryukov 2018-07-17 16:08:26 +00:00
parent 7aab30a907
commit d954d6213a
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

@ -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':

View File

@ -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 ),

View File

@ -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.