Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/19/2010 09:51:12 AM (14 years ago)
Author:
apeatling
Message:

Fixes issues with displaying profiles when the user_username and user_nicename are different values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core.php

    r2855 r2856  
    998998    global $wpdb;
    999999
    1000     if ( !empty( $username ) )
    1001         return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) );
     1000    if ( empty( $username ) )
     1001        return false;
     1002
     1003    return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) );
     1004}
     1005
     1006/**
     1007 * bp_core_get_userid_from_nicename()
     1008 *
     1009 * Returns the user_id for a user based on their user_nicename.
     1010 *
     1011 * @package BuddyPress Core
     1012 * @param $username str Username to check.
     1013 * @global $wpdb WordPress DB access object.
     1014 * @return false on no match
     1015 * @return int the user ID of the matched user.
     1016 */
     1017function bp_core_get_userid_from_nicename( $user_nicename ) {
     1018    global $wpdb;
     1019
     1020    if ( empty( $user_nicename ) )
     1021        return false;
     1022
     1023    return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_nicename = %s", $user_nicename ) ) );
    10021024}
    10031025
Note: See TracChangeset for help on using the changeset viewer.