Ticket #2828: 2828.3.diff
File 2828.3.diff, 1.5 KB (added by , 10 years ago) |
---|
-
src/includes/core/template-functions.php
468 468 * @param WP_Query $posts_query 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 475 474 * @uses is_user_member_of_blog() To check if user profile page exists … … 511 510 // Setup the default user variable 512 511 $the_user = false; 513 512 514 // If using pretty permalinks, use the email orslug513 // If using pretty permalinks, use the slug 515 514 if ( get_option( 'permalink_structure' ) ) { 515 $the_user = get_user_by( 'slug', $bbp_user ); 516 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 ) ) { 517 // If not using permalinks, get the user by ID 518 } elseif ( is_numeric( $bbp_user ) ) { 529 519 $the_user = get_user_by( 'id', $bbp_user ); 530 520 } 531 521