Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_API_Authentication::get_user_by_id( int $user_id )
Get user by ID
Description Description
Parameters Parameters
- $user_id
-
(Required)
Return Return
(WP_User)
Source Source
File: includes/legacy/api/v2/class-wc-api-authentication.php
private function get_user_by_id( $user_id ) { $user = get_user_by( 'id', $user_id ); if ( ! $user ) { throw new Exception( __( 'API user is invalid', 'woocommerce' ), 401 ); } return $user; }
Changelog Changelog
Version | Description |
---|---|
2.4.0 | Introduced. |