Last Updated: February 25, 2016
·
583
· codebyjeff

A Better WordPress User Object

1 Response
Add your 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 ·