Changeset 2856 for branches/1.2/bp-core.php
- Timestamp:
- 03/19/2010 09:51:12 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core.php
r2855 r2856 998 998 global $wpdb; 999 999 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 */ 1017 function 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 ) ) ); 1002 1024 } 1003 1025
Note: See TracChangeset
for help on using the changeset viewer.