Skip to:
Content

bbPress.org

Ticket #2828: 2828.3.diff

File 2828.3.diff, 1.5 KB (added by netweb, 10 years ago)
  • src/includes/core/template-functions.php

     
    468468 * @param WP_Query $posts_query
    469469 *
    470470 * @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
    473472 * @uses get_userdata() to get the user data
    474473 * @uses current_user_can() To check if the current user can edit the user
    475474 * @uses is_user_member_of_blog() To check if user profile page exists
     
    511510                // Setup the default user variable
    512511                $the_user = false;
    513512
    514                 // If using pretty permalinks, use the email or slug
     513                // If using pretty permalinks, use the slug
    515514                if ( get_option( 'permalink_structure' ) ) {
     515                        $the_user = get_user_by( 'slug', $bbp_user );
    516516
    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 ) ) {
    529519                        $the_user = get_user_by( 'id', $bbp_user );
    530520                }
    531521