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

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 21 10:13:31 GMT 2009


#7540: allow multiple values for key in usermeta
-------------------------+--------------------------------------------------
 Reporter:  wnorris      |        Type:  enhancement
   Status:  new          |    Priority:  normal     
Milestone:  2.8          |   Component:  Users      
  Version:  2.6.1        |    Severity:  normal     
 Keywords:  needs-patch  |  
-------------------------+--------------------------------------------------

Comment(by Denis-de-Bernardy):

 here's the potentially ugly use-case...

 first:

 {{{
 add_user_meta($user_id, 'foo', 'bar', false);
 var_dump(get_user_meta($user_id, 'foo')); // array(0=>'bar')
 }}}

 then:

 {{{
 $user = new WP_User($user_id);
 var_dump($user->foo); // 'bar'
 }}}

 the only workaround I can think of is to store the $single status into the
 user_meta table.

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


More information about the wp-trac mailing list