WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/15/2019 10:34:39 PM (13 months ago)
Author:
desrosj
Message:

Privacy: Use consistent variable naming when working with privacy requests.

Throughout the core privacy functions, WP_User_Request instances were stored in variables named both $request, and $request_data. This changes all occurrences of $request_data to $request for better consistency.

Props nateallen, bruceallen, garrett-eclipse.
Fixes #44708.

File:
1 edited

Legend:

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

    r43665 r44606  
    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 $result 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 );
    626 
    627     if ( ! $request_data ) {
     624    $request_id = absint( $request_id );
     625    $request    = wp_get_user_request_data( $request_id );
     626
     627    if ( ! $request ) {
    628628        return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
    629629    }
     
    631631    update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );
    632632
    633     $request = wp_update_post(
     633    $result = wp_update_post(
    634634        array(
    635635            'ID'          => $request_id,
     
    638638    );
    639639
    640     return $request;
     640    return $result;
    641641}
    642642
Note: See TracChangeset for help on using the changeset viewer.