bp_user_query_populate_extras

Allows users to independently populate custom extras.

Description

do_action( 'bp_user_query_populate_extras', (array) $array ); 

Note that anything you add here should query using $user_ids_sql, to avoid running multiple queries per user in the loop.

Two BuddyPress components currently do this: - XProfile: To override display names. - Friends: To set whether or not a user is the current users friend.

Parameters (1)

0. $array (array) => array( $this, $user_ids_sql )
The array.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'bp_user_query_populate_extras', $array ); 
The following example is for adding a hook callback.
  1. // define the bp_user_query_populate_extras callback 
  2. function action_bp_user_query_populate_extras( $array ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'bp_user_query_populate_extras', 'action_bp_user_query_populate_extras', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'bp_user_query_populate_extras', 'action_bp_user_query_populate_extras', 10, 1 ); 

Defined (1)

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

/bp-core/classes/class-bp-user-query.php  
  1. do_action_ref_array( 'bp_user_query_populate_extras', array( $this, $user_ids_sql ) );