Changeset 5813
- Timestamp:
- 07/12/2015 11:53:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/template-functions.php
r5770 r5813 469 469 * 470 470 * @uses get_query_var() To get {@link WP_Query} query var 471 * @uses is_email() To check if the string is an email 472 * @uses get_user_by() To try to get the user by email and nicename 471 * @uses get_user_by() To try to get the user by nicename or id 473 472 * @uses get_userdata() to get the user data 474 473 * @uses current_user_can() To check if the current user can edit the user … … 512 511 $the_user = false; 513 512 514 // If using pretty permalinks, use the email orslug513 // If using pretty permalinks, always use slug 515 514 if ( get_option( 'permalink_structure' ) ) { 516 517 // Email was passed 518 if ( is_email( $bbp_user ) ) { 519 $the_user = get_user_by( 'email', $bbp_user ); 520 521 // Try nicename 522 } else { 523 $the_user = get_user_by( 'slug', $bbp_user ); 524 } 525 } 526 527 // No user found by slug/email, so try the ID if it's numeric 528 if ( empty( $the_user ) && is_numeric( $bbp_user ) ) { 515 $the_user = get_user_by( 'slug', $bbp_user ); 516 517 // If not using pretty permalinks, always use numeric ID 518 } elseif ( is_numeric( $bbp_user ) ) { 529 519 $the_user = get_user_by( 'id', $bbp_user ); 530 520 }
Note: See TracChangeset
for help on using the changeset viewer.