wpseek.com
A WordPress-centric search engine for devs and theme authors
get_user_by › WordPress Function
Since2.8.0
Deprecatedn/a
› get_user_by ( $field, $value )
Parameters: (2) |
|
Returns: |
|
Defined at: |
|
Codex: | |
Change Log: |
|
Retrieves user info by a given field.
Source
function get_user_by( $field, $value ) {
$userdata = WP_User::get_data_by( $field, $value );
if ( ! $userdata ) {
return false;
}
$user = new WP_User();
$user->init( $userdata );
return $user;
}
endif;
if ( ! function_exists( 'cache_users' ) ) :
/**
* Retrieves info for user lists to prevent multiple queries by get_userdata().
*
* @since 3.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int[] $user_ids User ID numbers list
*/