bb_get_user_by_nicename

The BuddyPress bb get user by nicename function.

Description

bb_get_user_by_nicename( (string) $nicename ); 

Parameters (1)

0. $nicename (string)
The nicename.

Usage

  1. if ( !function_exists( 'bb_get_user_by_nicename' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-users.php'; 
  3.  
  4. // The nicename. 
  5. $nicename = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_get_user_by_nicename($nicename); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-users.php  
  1. function bb_get_user_by_nicename( $nicename ) { 
  2. global $wp_users_object; 
  3. $user = $wp_users_object->get_user( $nicename, array( 'by' => 'nicename' ) ); 
  4. if ( is_wp_error($user) ) 
  5. return false; 
  6. return bb_get_user( $user->ID );