[wp-hackers] get_user_meta returning empty string

Muro, Matthew mmuro at advance.ua.edu
Wed Nov 24 16:11:55 UTC 2010


Hey guys,

I'm using the get_user_meta function to grab the wp_capabilities of a user, but in some cases it's returning an empty string instead of an array.

Here's how I'm using the function:  get_user_meta( $current_user->ID, 'wp_capabilities', true );

Depending on the server, a successful response is something like array(1) { ["administrator"]=> string(1) "1" } or array(1) { ["administrator"]=> bool(true) }.  However, the cases where it fails returns this string(0) "".

According to the Codex, it should at least return the value I'm looking for.  What would cause get_user_meta to return an empty string?

Thanks,

Matthew Muro
Web Developer
UA Office of Web Communications







More information about the wp-hackers mailing list