WordPress.org

Make WordPress Core

Changeset 43073


Ignore:
Timestamp:
05/01/2018 11:48:21 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Privacy: fix error message and list table sorting errors on the Export Personal Data and Remove Personal Data screens.

Props azaozz.
Merges [42977] to the 4.9 branch.
See #43481.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/user.php

    r43071 r43073  
    753753                            'username_or_email_to_export',
    754754                            'username_or_email_to_export',
    755                             __( 'Unable to add export request. A valid email address or username must be supplied.' ),
     755                            __( 'Unable to add this request. A valid email address or username must be supplied.' ),
    756756                            'error'
    757757                        );
     
    940940     * Action name for the requests this table will work with. Classes
    941941     * which inherit from WP_Privacy_Requests_Table should define this.
    942      * e.g. 'user_export_request'
     942     * e.g. 'export_personal_data'
    943943     *
    944944     * @since 5.0.0
     
    947947     */
    948948    protected $request_type = 'INVALID';
     949
     950    /**
     951     * Post type to be used.
     952     *
     953     * @since 5.0.0
     954     *
     955     * @var string $post_type The post type.
     956     */
     957    protected $post_type = 'INVALID';
    949958
    950959    /**
     
    10011010        $views          = array();
    10021011        $admin_url      = admin_url( 'tools.php?page=' . $this->request_type );
    1003         $counts         = wp_count_posts( $this->request_type );
     1012        $counts         = wp_count_posts( $this->post_type );
    10041013
    10051014        $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
     
    10961105        $posts_per_page = 20;
    10971106        $args           = array(
    1098             'post_type'      => $this->request_type,
     1107            'post_type'      => $this->post_type,
    10991108            'posts_per_page' => $posts_per_page,
    11001109            'offset'         => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page: 0,
     
    12831292class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
    12841293    /**
    1285      * Action name for the requests this table will work with. Classes
    1286      * which inherit from WP_Privacy_Requests_Table should define this.
    1287      * e.g. 'user_export_request'
     1294     * Action name for the requests this table will work with.
    12881295     *
    12891296     * @since 5.0.0
     
    12911298     * @var string $request_type Name of action.
    12921299     */
    1293     protected $request_type = 'user_export_request';
     1300    protected $request_type = 'export_personal_data';
     1301
     1302    /**
     1303     * Post type for the requests.
     1304     *
     1305     * @since 5.0.0
     1306     *
     1307     * @var string $post_type The post type.
     1308     */
     1309    protected $post_type = 'user_export_request';
    12941310
    12951311    /**
     
    13461362class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
    13471363    /**
    1348      * Action name for the requests this table will work with. Classes
    1349      * which inherit from WP_Privacy_Requests_Table should define this.
    1350      * e.g. 'user_remove_request'
     1364     * Action name for the requests this table will work with.
    13511365     *
    13521366     * @since 5.0.0
     
    13541368     * @var string $request_type Name of action.
    13551369     */
    1356     protected $request_type = 'user_remove_request';
     1370    protected $request_type = 'remove_personal_data';
     1371
     1372    /**
     1373     * Post type for the requests.
     1374     *
     1375     * @since 5.0.0
     1376     *
     1377     * @var string $post_type The post type.
     1378     */
     1379    protected $post_type = 'user_remove_request';
    13571380
    13581381    /**
Note: See TracChangeset for help on using the changeset viewer.