Changeset 54544 for branches/6.0/src/wp-includes/pluggable.php
- Timestamp:
- 10/17/2022 04:53:54 PM (2 years ago)
- Location:
- branches/6.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0
-
branches/6.0/src/wp-includes/pluggable.php
r54539 r54544 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.95 94 * 96 95 * @global WP_User $current_user The current user object which holds the user data. … … 101 100 */ 102 101 function get_user_by( $field, $value ) { 103 global $current_user;104 105 102 $userdata = WP_User::get_data_by( $field, $value ); 106 103 107 104 if ( ! $userdata ) { 108 105 return false; 109 }110 111 if ( $current_user instanceof WP_User && $current_user->ID === (int) $userdata->ID ) {112 return $current_user;113 106 } 114 107
Note: See TracChangeset
for help on using the changeset viewer.