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-includes/user.php

    r50935 r50981  
    28742874
    28752875    wp_set_password( $new_pass, $user->ID );
    2876     update_user_option( $user->ID, 'default_password_nag', false, true );
     2876    update_user_meta( $user->ID, 'default_password_nag', false );
    28772877
    28782878    /**
     
    29852985    }
    29862986
    2987     update_user_option( $user_id, 'default_password_nag', true, true ); // Set up the password change nag.
     2987    update_user_meta( $user_id, 'default_password_nag', true ); // Set up the password change nag.
    29882988
    29892989    /**
Note: See TracChangeset for help on using the changeset viewer.