CodeExplorer get_data_by example
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;
elseif ( is_object( $id ) ) { $this->
init( $id,
$site_id );
return;
} if ( !
empty( $id ) && !
is_numeric( $id ) ) { $name =
$id;
$id = 0;
} if ( $id ) { $data = self::
get_data_by( 'id',
$id );
} else { $data = self::
get_data_by( 'login',
$name );
} if ( $data ) { $this->
init( $data,
$site_id );
} else { $this->data =
new stdClass();
} }