[wp-trac] Re: [WordPress Trac] #7540: allow multiple values for key in usermeta

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 16 19:09:58 GMT 2009


#7540: allow multiple values for key in usermeta
-------------------------+--------------------------------------------------
 Reporter:  wnorris      |       Owner:  anonymous                 
     Type:  enhancement  |      Status:  new                       
 Priority:  normal       |   Milestone:  2.8                       
Component:  General      |     Version:  2.6.1                     
 Severity:  normal       |    Keywords:  usermeta, users, has-patch
-------------------------+--------------------------------------------------

Comment(by misterbisson):

 @ryan. Yeah, I knew somebody was going to call me on that.

 I've updated _fill_user() to use update_usermeta_cache(). There are three
 caches _fill_user() sets up:

 {{{
         wp_cache_add($user->ID, $user, 'users');
         wp_cache_add($user->user_login, $user->ID, 'userlogins');
         wp_cache_add($user->user_email, $user->ID, 'useremail');
 }}}

 This change to allow multiple entries for a meta_key has serious
 implications for the users cache, as there's a lot of code that expects
 there to be only one entry per meta_key there. The other two caches are
 based on data in the users table and unaffected by this change.

 The approach I took is to preserve the format of the users cache (one
 value per meta_key). The increased memory usage implications are probably
 minimal for most sites (/broad assumption), though a future patch could
 normalize these caches.

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


More information about the wp-trac mailing list