WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/02/2018 03:43:37 AM (17 months ago)
Author:
SergeyBiryukov
Message:

Privacy: improve wp_privacy_erase_personal_data(), return boolean values.

Props ericdaams.
Merges [43061] to the 4.9 branch.
See #43602.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/ajax-actions.php

    r43107 r43110  
    42564256     *
    42574257     *         @type string $callback               Callable eraser that accepts an email address and
    4258      *                                              a page and returns an array with the number of items
    4259      *                                              removed, the number of items retained and any messages
     4258     *                                              a page and returns an array with boolean values for
     4259     *                                              whether items were removed or retained and any messages
    42604260     *                                              from the eraser, as well as if additional pages are
    42614261     *                                              available.
     
    43244324        }
    43254325
    4326         if ( ! array_key_exists( 'num_items_removed', $response ) ) {
     4326        if ( ! array_key_exists( 'items_removed', $response ) ) {
    43274327            wp_send_json_error(
    43284328                sprintf(
    43294329                    /* translators: 1: eraser friendly name, 2: array index */
    4330                     __( 'Expected num_items_removed key in response array from %1$s eraser (index %2$d).' ),
     4330                    __( 'Expected items_removed key in response array from %1$s eraser (index %2$d).' ),
    43314331                    esc_html( $eraser_friendly_name ),
    43324332                    $eraser_index
     
    43354335        }
    43364336
    4337         if ( ! array_key_exists( 'num_items_retained', $response ) ) {
     4337        if ( ! array_key_exists( 'items_retained', $response ) ) {
    43384338            wp_send_json_error(
    43394339                sprintf(
    43404340                    /* translators: 1: eraser friendly name, 2: array index */
    4341                     __( 'Expected num_items_retained key in response array from %1$s eraser (index %2$d).' ),
     4341                    __( 'Expected items_retained key in response array from %1$s eraser (index %2$d).' ),
    43424342                    esc_html( $eraser_friendly_name ),
    43434343                    $eraser_index
     
    43814381        // No erasers, so we're done.
    43824382        $response = array(
    4383             'num_items_removed'  => 0,
    4384             'num_items_retained' => 0,
    4385             'messages'           => array(),
    4386             'done'               => true,
     4383            'items_removed'  => false,
     4384            'items_retained' => false,
     4385            'messages'       => array(),
     4386            'done'           => true,
    43874387        );
    43884388    }
Note: See TracChangeset for help on using the changeset viewer.