WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/02/2021 07:43:37 PM (10 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-includes/user.php

    r50141 r50159  
    39383938 * @since 4.9.6
    39393939 *
    3940  * @param string $email_address User email address. This can be the address of a registered or non-registered user.
    3941  * @param string $action_name   Name of the action that is being confirmed. Required.
    3942  * @param array  $request_data  Misc data you want to send with the verification request and pass to the actions once the request is confirmed.
    3943  * @return int|WP_Error Returns the request ID if successful, or a WP_Error object on failure.
    3944  */
    3945 function wp_create_user_request( $email_address = '', $action_name = '', $request_data = array() ) {
     3940 * @param string $email_address           User email address. This can be the address of a registered or non-registered user.
     3941 * @param string $action_name             Name of the action that is being confirmed. Required.
     3942 * @param array  $request_data            Misc data you want to send with the verification request and pass to the actions once the request is confirmed.
     3943 * @param bool   $send_confirmation_email Optional. True by default, if false is passed the request status is set to Completed directly.
     3944 * @return int|WP_Error                   Returns the request ID if successful, or a WP_Error object on failure.
     3945 */
     3946function wp_create_user_request( $email_address = '', $action_name = '', $request_data = array(), $send_confirmation_email = true ) {
    39463947    $email_address = sanitize_email( $email_address );
    39473948    $action_name   = sanitize_key( $action_name );
     
    39763977    }
    39773978
     3979    if ( false !== $send_confirmation_email ) {
     3980        $status = 'request-pending';
     3981    } else {
     3982        $status = 'request-completed';
     3983    }
     3984
    39783985    $request_id = wp_insert_post(
    39793986        array(
     
    39823989            'post_title'    => $email_address,
    39833990            'post_content'  => wp_json_encode( $request_data ),
    3984             'post_status'   => 'request-pending',
     3991            'post_status'   => $status,
    39853992            'post_type'     => 'user_request',
    39863993            'post_date'     => current_time( 'mysql', false ),
Note: See TracChangeset for help on using the changeset viewer.