[wp-trac] [WordPress Trac] #11254: update_usermeta and delete_usermeta do not update or destroy cache

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 10 11:26:06 UTC 2010


#11254: update_usermeta and delete_usermeta do not update or destroy cache
--------------------------+-------------------------------------------------
 Reporter:  mark8barnes   |       Owner:  ryan         
     Type:  defect (bug)  |      Status:  new          
 Priority:  normal        |   Milestone:  3.0          
Component:  Cache         |     Version:  2.8.5        
 Severity:  minor         |    Keywords:  needs-testing
--------------------------+-------------------------------------------------

Comment(by hawy.php):

 Replying to [comment:5 nacin]:
 > It's been pointed out (thanks hawy) that setup_userdata() is incorrect.
 Proper approach would be {{{$GLOBALS['current_user'] = new WP_User($id,
 $name);}}}
 >
 > We shouldn't need to call setup_userdata() at all, as that doesn't set
 up any meta in the back compat globals it maintains.


 we need setup_userdata() cause it fills the old global variable (
 $userdata ) with user's metadata

 so if we didn't call it
 and assume we have meta_key = "somemeta" and it's value was "old_value"
 and some one made

  update_usermeta( 1, "somemeta","new_value");
 then
 var_dump($userdata);

 we still get old_value

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11254#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list