WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/02/2021 07:43:37 PM (4 months ago)
Author:
antpb
Message:

Privacy: Allow Admin to Skip e-mail confirmation for Export.

This adds a form option to skip the admin email alert when exporting personal data.

Props xkon, azaozz, TZ-Media, iandunn, desrosj, iprg, allendav, wesselvandenberg, karmatosed, birgire, davidbaumwald, estelaris, paaljoachim, hellofromTonya.
Fixes #43890.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/privacy-tools.php

    r50055 r50159  
    112112                $username_or_email_address = sanitize_text_field( wp_unslash( $_POST['username_or_email_for_privacy_request'] ) );
    113113                $email_address             = '';
     114                $send_confirmation_email   = true;
     115
     116                if ( ! isset( $_POST['send_confirmation_email'] ) ) {
     117                    $send_confirmation_email   = false;
     118                }
    114119
    115120                if ( ! in_array( $action_type, _wp_privacy_action_request_types(), true ) ) {
     
    142147                }
    143148
    144                 $request_id = wp_create_user_request( $email_address, $action_type );
     149                $request_id = wp_create_user_request( $email_address, $action_type, array(), $send_confirmation_email );
    145150
    146151                if ( is_wp_error( $request_id ) ) {
     
    162167                }
    163168
    164                 wp_send_user_request( $request_id );
     169                if ( $send_confirmation_email ) {
     170                    wp_send_user_request( $request_id );
     171                }
    165172
    166173                add_settings_error(
Note: See TracChangeset for help on using the changeset viewer.