bp_core_get_core_userdata

Fetch everything in the wp_users table for a user, without any usermeta.

Description

(array) bp_core_get_core_userdata( (int) $user_id = 0 ); 

Returns (array)

Parameters (1)

0. $user_id — Optional. (int)
The ID of the user.

Usage

  1. if ( !function_exists( 'bp_core_get_core_userdata' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-functions.php'; 
  3.  
  4. // The ID of the user. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_get_core_userdata($user_id); 
  9.  

Defined (1)

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

/bp-members/bp-members-functions.php  
  1. function bp_core_get_core_userdata( $user_id = 0 ) { 
  2. if ( empty( $user_id ) ) { 
  3. return false; 
  4.  
  5. if ( !$userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ) ) { 
  6. $userdata = BP_Core_User::get_core_userdata( $user_id ); 
  7. wp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' ); 
  8.  
  9. /** 
  10. * Filters the userdata for a passed user. 
  11. * @since 1.2.0 
  12. * @param array $userdata Array of user data for a passed user. 
  13. */