WordPress.org

Make WordPress Core

Changeset 44906


Ignore:
Timestamp:
03/15/2019 04:26:55 PM (2 months ago)
Author:
desrosj
Message:

Privacy: Allow new requests to be created after a user’s existing one has been completed.

When dealing with personal data exports and erasure requests, it is important to have a log of all the requests for a specific person. This is often required to confirm when and how many times requests were completed and fulfilled properly.

This change allows a new request to be created after a previous data request has reached completed status (request-completed) instead of requiring admins to delete or re-initiate the existing request. The latter approach removes the historical log of requests for that user when creating a new request.

Full unit tests for the wp_create_user_request() function are also included.

Props garrett-eclipse, cc0a, birgire, desrosj.
Fixes #44707.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r44784 r44906  
    33313331            'post_name__in' => array( $action_name ),  // Action name stored in post_name column.
    33323332            'title'         => $email_address, // Email address stored in post_title column.
    3333             'post_status'   => 'any',
     3333            'post_status'   => array(
     3334                'request-pending',
     3335                'request-confirmed',
     3336            ),
    33343337            'fields'        => 'ids',
    33353338        )
     
    33373340
    33383341    if ( $requests_query->found_posts ) {
    3339         return new WP_Error( 'duplicate_request', __( 'A request for this email address already exists.' ) );
     3342        return new WP_Error( 'duplicate_request', __( 'An incomplete request for this email address already exists.' ) );
    33403343    }
    33413344
Note: See TracChangeset for help on using the changeset viewer.