Make WordPress Core


Ignore:
Timestamp:
04/13/2018 04:14:54 PM (6 years ago)
Author:
azaozz
Message:

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

See #43481.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/user.php

    r42967 r42977  
    794794                            'username_or_email_to_export',
    795795                            'username_or_email_to_export',
    796                             __( 'Unable to add export request. A valid email address or username must be supplied.' ),
     796                            __( 'Unable to add this request. A valid email address or username must be supplied.' ),
    797797                            'error'
    798798                        );
     
    981981     * Action name for the requests this table will work with. Classes
    982982     * which inherit from WP_Privacy_Requests_Table should define this.
    983      * e.g. 'user_export_request'
     983     * e.g. 'export_personal_data'
    984984     *
    985985     * @since 5.0.0
     
    988988     */
    989989    protected $request_type = 'INVALID';
     990
     991    /**
     992     * Post type to be used.
     993     *
     994     * @since 5.0.0
     995     *
     996     * @var string $post_type The post type.
     997     */
     998    protected $post_type = 'INVALID';
    990999
    9911000    /**
     
    10421051        $views          = array();
    10431052        $admin_url      = admin_url( 'tools.php?page=' . $this->request_type );
    1044         $counts         = wp_count_posts( $this->request_type );
     1053        $counts         = wp_count_posts( $this->post_type );
    10451054
    10461055        $current_link_attributes = empty( $current_status ) ? ' class="current" aria-current="page"' : '';
     
    11371146        $posts_per_page = 20;
    11381147        $args           = array(
    1139             'post_type'      => $this->request_type,
     1148            'post_type'      => $this->post_type,
    11401149            'posts_per_page' => $posts_per_page,
    11411150            'offset'         => isset( $_REQUEST['paged'] ) ? max( 0, absint( $_REQUEST['paged'] ) - 1 ) * $posts_per_page: 0,
     
    13241333class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
    13251334    /**
    1326      * Action name for the requests this table will work with. Classes
    1327      * which inherit from WP_Privacy_Requests_Table should define this.
    1328      * e.g. 'user_export_request'
     1335     * Action name for the requests this table will work with.
    13291336     *
    13301337     * @since 5.0.0
     
    13321339     * @var string $request_type Name of action.
    13331340     */
    1334     protected $request_type = 'user_export_request';
     1341    protected $request_type = 'export_personal_data';
     1342
     1343    /**
     1344     * Post type for the requests.
     1345     *
     1346     * @since 5.0.0
     1347     *
     1348     * @var string $post_type The post type.
     1349     */
     1350    protected $post_type = 'user_export_request';
    13351351
    13361352    /**
     
    13871403class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
    13881404    /**
    1389      * Action name for the requests this table will work with. Classes
    1390      * which inherit from WP_Privacy_Requests_Table should define this.
    1391      * e.g. 'user_remove_request'
     1405     * Action name for the requests this table will work with.
    13921406     *
    13931407     * @since 5.0.0
     
    13951409     * @var string $request_type Name of action.
    13961410     */
    1397     protected $request_type = 'user_remove_request';
     1411    protected $request_type = 'remove_personal_data';
     1412
     1413    /**
     1414     * Post type for the requests.
     1415     *
     1416     * @since 5.0.0
     1417     *
     1418     * @var string $post_type The post type.
     1419     */
     1420    protected $post_type = 'user_remove_request';
    13981421
    13991422    /**
Note: See TracChangeset for help on using the changeset viewer.