Changeset 4383
- Timestamp:
- 05/18/2011 07:34:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-functions.php
r4372 r4383 443 443 444 444 /** 445 * Returns the user link for the user based on user's username 446 * 447 * @package BuddyPress Core 448 * @param $username str The username for the user. 449 * @uses bp_core_get_userlink() BuddyPress function to get a userlink by user ID. 445 * Returns the user link for the user based on the supplied identifier 446 * 447 * @param $username str If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, this will be user_login, otherwise it will be user_nicename. 450 448 * @return str The link to the users home base. False on no match. 451 449 */ 452 450 function bp_core_get_userlink_by_username( $username ) { 453 global $wpdb; 454 455 $user_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ); 451 if ( defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) ) 452 $user_id = bp_core_get_userid( $username ); 453 else 454 $user_id = bp_core_get_userid_from_nicename( $username ); 455 456 456 return apply_filters( 'bp_core_get_userlink_by_username', bp_core_get_userlink( $user_id, false, false, true ) ); 457 457 }
Note: See TracChangeset
for help on using the changeset viewer.