[wp-hackers] get_user_meta returning empty string

scribu mail at scribu.net
Wed Nov 24 17:37:56 UTC 2010


On Wed, Nov 24, 2010 at 7:35 PM, scribu <mail at scribu.net> wrote:

> On Wed, Nov 24, 2010 at 7:16 PM, Muro, Matthew <mmuro at advance.ua.edu>wrote:
>
>> Never underestimate the power of posting.  The problem ended up being that
>> someone using a different $table_prefix other than "wp_" wouldn't have the
>> meta_key "wp_capabilities".
>>
>> Let me know if I'm jumping to conclusions here, but I'm able to reproduce
>> the error.
>>
>
> That would only happen if you change the table prefix *after* WP is
> installed.
>

To clarify, the capability key is generated based on the table prefix. This
allows users to have different capabilities on different sites in a
MultiSite environment.

Also, you should probably be using get_userdata() instead.


More information about the wp-hackers mailing list