[wp-trac] [WordPress Trac] #31341: Works faster about update_user_option()

WordPress Trac noreply at wordpress.org
Mon Feb 16 06:28:41 UTC 2015


#31341: Works faster about update_user_option()
-------------------------+-----------------------------
 Reporter:  kmvan        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Users        |    Version:  4.1
 Severity:  normal       |   Keywords:
  Focuses:  performance  |
-------------------------+-----------------------------
 /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 );
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31341>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list