Getting all user metadata from user

WP_User objects have some magic methods which do allow you to access any custom field:

foreach ( $agents as $agent ) {
  var_dump( $agent->bio );
  var_dump( $agent->get( 'bio' ) );
}

The two are equivalent.

More info: http://scribu.net/wordpress/the-magic-of-wp_user.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)