diff --git a/wp-admin/includes/admin-filters.php b/wp-admin/includes/admin-filters.php index f071718bfe..ba05b8df98 100644 --- a/wp-admin/includes/admin-filters.php +++ b/wp-admin/includes/admin-filters.php @@ -133,6 +133,7 @@ add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 ); add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 ); // Privacy hooks +add_filter( 'wp_privacy_personal_data_erasure_page', 'wp_privacy_process_personal_data_erasure_page', 10, 5 ); add_filter( 'wp_privacy_personal_data_export_page', 'wp_privacy_process_personal_data_export_page', 10, 7 ); add_action( 'wp_privacy_personal_data_export_file', 'wp_privacy_generate_personal_data_export_file', 10 ); diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index 81654535c6..12f3d965a3 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -876,6 +876,74 @@ function _wp_personal_data_removal_page() { action_name ) { + wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) ); + } + + /** This filter is documented in wp-admin/includes/ajax-actions.php */ + $erasers = apply_filters( 'wp_privacy_personal_data_erasers', array() ); + $is_last_eraser = count( $erasers ) === $eraser_index; + $eraser_done = $response['done']; + + if ( ! $is_last_eraser || ! $eraser_done ) { + return $response; + } + + _wp_privacy_completed_request( $request_id ); + + return $response; +} + /** * Add requests pages. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 1b95973064..4b6e7d0f1d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.6-beta1-43187'; +$wp_version = '4.9.6-beta1-43188'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.