WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/24/2021 07:58:13 PM (5 months ago)
Author:
desrosj
Message:

General: Avoid unnecessary calls to update_user_option().

The update_user_option() function is a way to update a user meta value after adding a blog’s prefix to the beginning of the meta key. But when the fourth parameter is true, the behavior is exactly the same as calling update_user_meta() directly.

This replaces all instances of update_user_option() when the fourth parameter is true in Core with a direct call to update_user_meta() to prevent an unnecessary call to update_user_option().

Props johnjamesjacoby, zkancs, obenland, desrosj.
Fixes #43339.

File:
1 edited

Legend:

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

    r49927 r50981  
    483483    ) {
    484484        delete_user_setting( 'default_password_nag' );
    485         update_user_option( $user_ID, 'default_password_nag', false, true );
     485        update_user_meta( $user_ID, 'default_password_nag', false );
    486486    }
    487487}
     
    504504    if ( $new_data->user_pass != $old_data->user_pass ) {
    505505        delete_user_setting( 'default_password_nag' );
    506         update_user_option( $user_ID, 'default_password_nag', false, true );
     506        update_user_meta( $user_ID, 'default_password_nag', false );
    507507    }
    508508}
Note: See TracChangeset for help on using the changeset viewer.