friends_for_group_suggestion_ls

The BP Groups Suggestions friends for group suggestion ls function.

Description

friends_for_group_suggestion_ls( (type) $users_id ); 

Parameters (1)

0. $users_id (type)
The users id.

Usage

  1. if ( !function_exists( 'friends_for_group_suggestion_ls' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-groups-suggestions/bp-suggest-functions.php'; 
  3.  
  4. // The users id. 
  5. $users_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = friends_for_group_suggestion_ls($users_id); 
  9.  

Defined (1)

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

/bp-suggest-functions.php  
  1. function friends_for_group_suggestion_ls($users_id) { 
  2. if (is_user_logged_in()) { 
  3. $user_id = bp_loggedin_user_id(); 
  4. $my_friends = (array) friends_get_friend_user_ids($user_id); //get all friend ids 
  5. if ($users_id) { 
  6. $users_id = array_unique(array_merge($my_friends, $users_id)); 
  7. return $users_id; 
  8. } else { 
  9. $users_id = $my_friends; 
  10. return $users_id;