Changeset 50790 for trunk/src/wp-includes/pluggable.php
- Timestamp:
- 04/26/2021 01:02:34 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r50781 r50790 92 92 * @since 2.8.0 93 93 * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter. 94 * @since 5.8.0 Returns the global `$current_user` if it's the user being fetched. 94 95 * 95 96 * @param string $field The field to retrieve the user with. id | ID | slug | email | login. … … 98 99 */ 99 100 function get_user_by( $field, $value ) { 101 global $current_user; 102 100 103 $userdata = WP_User::get_data_by( $field, $value ); 101 104 102 105 if ( ! $userdata ) { 103 106 return false; 107 } 108 109 if ( $current_user instanceof WP_User && $current_user->ID === (int) $userdata->ID ) { 110 return $current_user; 104 111 } 105 112
Note: See TracChangeset
for help on using the changeset viewer.