Changeset 3894
- Timestamp:
- 08/31/2016 06:54:48 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-activity-handler/wporg-profiles-activity-handler.php
r3893 r3894 48 48 49 49 /** 50 * Gets a user by either login or slug.51 * 52 * @param string $username The user's login or slug.50 * Gets a user by either login, slug, or id. 51 * 52 * @param string|int $username The user's login, slug, or id. 53 53 * @return WP_User|false WP_User object on success, false on failure. 54 54 */ 55 55 protected function get_user( $username ) { 56 $user = get_user_by( 'login', $username ); 56 if ( is_numeric( $username ) && ( absint( $username ) == $username ) ) { 57 $user = get_user_by( 'id', $username ); 58 } else { 59 $user = get_user_by( 'login', $username ); 60 } 57 61 58 62 if ( ! $user ) { 59 $user = get_user_by( 'slug', $username);63 $user = get_user_by( 'slug', strtolower( $username ) ); 60 64 } 61 65
Note: See TracChangeset
for help on using the changeset viewer.