bb_set_current_user

The BuddyPress bb set current user function.

Description

bb_set_current_user( $id ); 

Parameters (1)

0. $id
The id.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php  
  1. function bb_set_current_user( $id ) { 
  2. global $wp_auth_object; 
  3. $current_user = $wp_auth_object->set_current_user( $id ); 
  4.  
  5. do_action('bb_set_current_user', isset($current_user->ID) ? $current_user->ID : 0 ); 
  6.  
  7. return $current_user;