Opened 11 years ago
Closed 11 years ago
#31341 closed enhancement (wontfix)
Works faster about update_user_option()
| Reported by: | kmvan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Users | Version: | 4.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | performance |
Description
/wp-includes/user.php in line 406
global $wpdb;
May move to the line 409 below. Becomes:
function update_user_option( $user_id, $option_name, $newvalue, $global = false ) {
if ( !$global ){
global $wpdb;
$option_name = $wpdb->get_blog_prefix() . $option_name;
}
return update_user_meta( $user_id, $option_name, $newvalue );
}
And delete_user_option() in line 432:
function delete_user_option( $user_id, $option_name, $global = false ) {
if ( !$global ){
global $wpdb;
$option_name = $wpdb->get_blog_prefix() . $option_name;
}
return delete_user_meta( $user_id, $option_name );
}
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This would be inconsistent with other functions (we generally declare globals at the beginning).
Do you have any performance benchmarks for this change? Please see https://make.wordpress.org/core/2011/03/23/code-refactoring/.