[wp-trac] [WordPress Trac] #11254: update_usermeta and delete_usermeta do not update or destroy cache
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 24 20:29:29 UTC 2009
#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: Database | Version: 2.8.5
Severity: minor | Keywords:
--------------------------+-------------------------------------------------
User meta data is stored in the `$current_user` variable, which is created
as GLOBAL by `get_currentuserinfo`. However, when `update_usermeta` and
`delete_usermeta` are called, this variable remains unchanged.
Subsequent calls to `get_currentuserinfo` just return the existing global
variable, and therefore return out of data meta information.
The solution is to check for the existence of the global variable
`$current_user` within the `update_usermeta` and `delete_usermeta`
functions and either update it or destroy it. Updating it might be more
useful, and could be done without needing to recreate the whole variable.
The change could theoretically break plugins if they assumed the existence
of the metadata in `$current_userinfo`, but I can't imagine why anyone
would, and it would hardly be good practice if they did.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11254>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list