bp_core_new_user_activity

Create a "became a registered user" activity item when a user activates his account.

Description

bp_core_new_user_activity( (array) $user ); 

Parameters (1)

0. $user (array)
Array of userdata passed to bp_core_activated_user hook.

Usage

  1. if ( !function_exists( 'bp_core_new_user_activity' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-activity.php'; 
  3.  
  4. // Array of userdata passed to bp_core_activated_user hook. 
  5. $user = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_new_user_activity($user); 
  9.  

Defined (1)

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

/bp-members/bp-members-activity.php  
  1. function bp_core_new_user_activity( $user ) { 
  2. if ( empty( $user ) ) { 
  3. return false; 
  4.  
  5. if ( is_array( $user ) ) { 
  6. $user_id = $user['user_id']; 
  7. } else { 
  8. $user_id = $user; 
  9.  
  10. if ( empty( $user_id ) ) { 
  11. return false; 
  12.  
  13. bp_activity_add( array( 
  14. 'user_id' => $user_id,  
  15. 'component' =>buddypress)->members->id,  
  16. 'type' => 'new_member' 
  17. ) );