From 35b558a3a0a74e173fe60c27bcf9d19e7ed32d94 Mon Sep 17 00:00:00 2001 From: desrosj Date: Fri, 15 Mar 2019 16:27:49 +0000 Subject: [PATCH] =?UTF-8?q?Privacy:=20Allow=20new=20requests=20to=20be=20c?= =?UTF-8?q?reated=20after=20a=20user=E2=80=99s=20existing=20one=20has=20be?= =?UTF-8?q?en=20completed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- wp-includes/user.php | 7 +++++-- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 064f5144f3..eb8f0a13aa 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -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( diff --git a/wp-includes/version.php b/wp-includes/version.php index 03f0b9eceb..92cca06b5e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.