bpbbpst_role_group_forum_map

Maps buddypress group mods to add their role in array.

Description

(array) bpbbpst_role_group_forum_map( (array) $users = array() ); 

Returns (array)

the users with their group "role"

Parameters (1)

0. $users — Optional. (array) => array()
The group users (mods or admins)

Usage

  1. if ( !function_exists( 'bpbbpst_role_group_forum_map' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddy-bbpress-support-topic/includes/functions.php'; 
  3.  
  4. // the group users (mods or admins) 
  5. $users = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bpbbpst_role_group_forum_map($users); 
  9.  

Defined (1)

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

/includes/functions.php  
  1. function bpbbpst_role_group_forum_map( $users = array() ) { 
  2.  
  3. $role = $users['role']; 
  4.  
  5. foreach ( $users['users'] as $key => $user ) { 
  6. if ( ! empty( $user->user_id ) ) { 
  7. $user->role = $role; 
  8. $users['users'][$key] = $user; 
  9.  
  10. return $users['users'];