bp_core_get_userlink_by_username

Return the user link for the user based on the supplied identifier.

Description

(string|bool) bp_core_get_userlink_by_username( (string) $username ); 

Returns (string|bool)

The link to the user's domain, false on no match.

Parameters (1)

0. $username (string)
If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, this should be user_login, otherwise it should be user_nicename.

Usage

  1. if ( !function_exists( 'bp_core_get_userlink_by_username' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-functions.php'; 
  3. $username = ''; 
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_get_userlink_by_username($username); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-members/bp-members-functions.php  
  1. function bp_core_get_userlink_by_username( $username ) { 
  2. $user_id = bp_core_get_userid( $username ); 
  3. } else { 
  4. $user_id = bp_core_get_userid_from_nicename( $username ); 
  5.  
  6. /** 
  7. * Filters the user link for the user based on username. 
  8. * @since 1.0.1 
  9. * @param string|bool $value URL for the user if found, otherwise false. 
  10. */ 
  11. return apply_filters( 'bp_core_get_userlink_by_username', bp_core_get_userlink( $user_id, false, false, true ) );