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. Built from https://develop.svn.wordpress.org/trunk@44906 git-svn-id: http://core.svn.wordpress.org/trunk@44737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8f69ebf812
commit
35b558a3a0
|
@ -3330,13 +3330,16 @@ function wp_create_user_request( $email_address = '', $action_name = '', $reques
|
|||
'post_type' => 'user_request',
|
||||
'post_name__in' => array( $action_name ), // Action name stored in post_name column.
|
||||
'title' => $email_address, // Email address stored in post_title column.
|
||||
'post_status' => 'any',
|
||||
'post_status' => array(
|
||||
'request-pending',
|
||||
'request-confirmed',
|
||||
),
|
||||
'fields' => 'ids',
|
||||
)
|
||||
);
|
||||
|
||||
if ( $requests_query->found_posts ) {
|
||||
return new WP_Error( 'duplicate_request', __( 'A request for this email address already exists.' ) );
|
||||
return new WP_Error( 'duplicate_request', __( 'An incomplete request for this email address already exists.' ) );
|
||||
}
|
||||
|
||||
$request_id = wp_insert_post(
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.2-alpha-44905';
|
||||
$wp_version = '5.2-alpha-44906';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue