WordPress.org

Make WordPress Core

Ticket #44708: 44708.patch

File 44708.patch, 5.1 KB (added by nateallen, 2 years ago)

Changes variables named $request_data to $request for consistency

  • wp-admin/includes/user.php

     
    618618 * @access private
    619619 *
    620620 * @param  int          $request_id Request ID.
    621  * @return int|WP_Error $request    Request ID on success or WP_Error.
     621 * @return int|WP_Error Request ID on success or WP_Error.
    622622 */
    623623function _wp_privacy_completed_request( $request_id ) {
    624         $request_id   = absint( $request_id );
    625         $request_data = wp_get_user_request_data( $request_id );
     624        $request_id = absint( $request_id );
     625        $request    = wp_get_user_request_data( $request_id );
    626626
    627         if ( ! $request_data ) {
     627        if ( ! $request ) {
    628628                return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
    629629        }
    630630
    631631        update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );
    632632
    633         $request = wp_update_post(
     633        return wp_update_post(
    634634                array(
    635635                        'ID'          => $request_id,
    636636                        'post_status' => 'request-completed',
    637637                )
    638638        );
    639 
    640         return $request;
    641639}
    642640
    643641/**
  • wp-includes/user.php

     
    29352935 * @param int $request_id ID of the request.
    29362936 */
    29372937function _wp_privacy_account_request_confirmed( $request_id ) {
    2938         $request_data = wp_get_user_request_data( $request_id );
     2938        $request = wp_get_user_request_data( $request_id );
    29392939
    2940         if ( ! $request_data ) {
     2940        if ( ! $request ) {
    29412941                return;
    29422942        }
    29432943
    2944         if ( ! in_array( $request_data->status, array( 'request-pending', 'request-failed' ), true ) ) {
     2944        if ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) {
    29452945                return;
    29462946        }
    29472947
     
    29652965 * @param int $request_id The ID of the request.
    29662966 */
    29672967function _wp_privacy_send_request_confirmation_notification( $request_id ) {
    2968         $request_data = wp_get_user_request_data( $request_id );
     2968        $request = wp_get_user_request_data( $request_id );
    29692969
    2970         if ( ! is_a( $request_data, 'WP_User_Request' ) || 'request-confirmed' !== $request_data->status ) {
     2970        if ( ! is_a( $request, 'WP_User_Request' ) || 'request-confirmed' !== $request->status ) {
    29712971                return;
    29722972        }
    29732973
     
    29772977                return;
    29782978        }
    29792979
    2980         $manage_url         = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
    2981         $action_description = wp_user_request_action_description( $request_data->action_name );
     2980        $manage_url         = add_query_arg( 'page', $request->action_name, admin_url( 'tools.php' ) );
     2981        $action_description = wp_user_request_action_description( $request->action_name );
    29822982
    29832983        /**
    29842984         * Filters the recipient of the data request confirmation notification.
     
    29912991         *
    29922992         * @since 4.9.6
    29932993         *
    2994          * @param string          $admin_email  The email address of the notification recipient.
    2995          * @param WP_User_Request $request_data The request that is initiating the notification.
     2994         * @param string          $admin_email The email address of the notification recipient.
     2995         * @param WP_User_Request $request    The request that is initiating the notification.
    29962996         */
    2997         $admin_email = apply_filters( 'user_request_confirmed_email_to', get_site_option( 'admin_email' ), $request_data );
     2997        $admin_email = apply_filters( 'user_request_confirmed_email_to', get_site_option( 'admin_email' ), $request );
    29982998
    29992999        $email_data = array(
    3000                 'request'     => $request_data,
    3001                 'user_email'  => $request_data->email,
     3000                'request'     => $request,
     3001                'user_email'  => $request->email,
    30023002                'description' => $action_description,
    30033003                'manage_url'  => $manage_url,
    30043004                'sitename'    => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
     
    31043104 * @param int $request_id The privacy request post ID associated with this request.
    31053105 */
    31063106function _wp_privacy_send_erasure_fulfillment_notification( $request_id ) {
    3107         $request_data = wp_get_user_request_data( $request_id );
     3107        $request = wp_get_user_request_data( $request_id );
    31083108
    3109         if ( ! is_a( $request_data, 'WP_User_Request' ) || 'request-completed' !== $request_data->status ) {
     3109        if ( ! is_a( $request, 'WP_User_Request' ) || 'request-completed' !== $request->status ) {
    31103110                return;
    31113111        }
    31123112
     
    31213121         *
    31223122         * @since 4.9.6
    31233123         *
    3124          * @param string          $user_email   The email address of the notification recipient.
    3125          * @param WP_User_Request $request_data The request that is initiating the notification.
     3124         * @param string          $user_email The email address of the notification recipient.
     3125         * @param WP_User_Request $request    The request that is initiating the notification.
    31263126         */
    3127         $user_email = apply_filters( 'user_erasure_fulfillment_email_to', $request_data->email, $request_data );
     3127        $user_email = apply_filters( 'user_erasure_fulfillment_email_to', $request->email, $request );
    31283128
    31293129        $email_data = array(
    3130                 'request'            => $request_data,
     3130                'request'            => $request,
    31313131                'message_recipient'  => $user_email,
    31323132                'privacy_policy_url' => get_privacy_policy_url(),
    31333133                'sitename'           => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),