You appear to be a bot. Output may be restricted
Description
Return user information
Usage
$WP_user = bw_get_user( $id, $hint );
Parameters
- $id
- ( string ) required – a value that can be used to access the user
- $hint
- ( string ) optional default: login – get_user_by( $hint, $id ) if we can't guess
Returns
WP_user object from get_user_by() Values for $field are: id: numeric email: contains @ slug: contains "-" indicating it's a user_nicename login: anything else Perhaps we should MAP username to login or viceversa anyway! ?Source
File name: oik/includes/bobbcomp.phpLines:
1 to 14 of 14
function bw_get_user( $id, $hint="login" ) { if ( is_numeric( $id ) ) { $field = "id"; } elseif ( is_email( $id ) ) { $field = "email"; } elseif ( strpos( $id, "-" ) !== false ) { $field = "slug"; // user_nicename; } else { $field = $hint; } $user = get_user_by( $field, $id ); // bw_trace2( $user ); return( $user ); }View on GitHub View on Trac