A Better WordPress User Object
Written by Jeff Madsen
Related protips
1 Response
If you look at the source for WPUser - https://github.com/WordPress/WordPress/blob/master/wp-includes/capabilities.php#L406 - you would see that it also implements the `get(),
isset()and
_set()` magic methods.
It's also important to know that a single call to get_user_meta()
loads all of the users meta fields into the WP object cache. This way any subsequent calls to either get_user_meta()
or WP_User::__get()
would not require a trip to the DB.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Wordpress
Authors
Related Tags
#wordpress
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#