bp_get_groups_activity_visibility

The BuddyPress Activity Privacy bp get groups activity visibility function.

Description

bp_get_groups_activity_visibility(); 

Usage

  1. if ( !function_exists( 'bp_get_groups_activity_visibility' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-activity-privacy/includes/bp-activity-privacy-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_groups_activity_visibility(); 
  7.  

Defined (1)

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

/includes/bp-activity-privacy-template.php  
  1. function bp_get_groups_activity_visibility() { 
  2. global $bp_activity_privacy; 
  3.  
  4. $visibility_levels = bp_get_groups_activity_visibility_levels(); 
  5. //sort visibility_levels by position  
  6. uasort ($visibility_levels, 'bp_activity_privacy_cmp_position'); 
  7.  
  8. $html = '<select name="activity-privacy" id="activity-privacy">'; 
  9. $html .= '<option selected disabled>' . __( 'Who can see this?', 'bp-activity-privacy' ) .'</option>'; 
  10. foreach ($visibility_levels as $visibility_level) { 
  11. if( isset($visibility_level["disabled"]) && $visibility_level["disabled"]) 
  12. continue; 
  13.  
  14. $html .= '<option class="fa fa-' . $visibility_level["id"] . '" ' . ( $visibility_level['default'] == true ? " selected='selected'" : '' ) . ' value="' . $visibility_level["id"] . '">' . $visibility_level["label"] . '</option>'; 
  15.  
  16. $html .= '</select>'; 
  17.  
  18. return apply_filters( 'bp_get_groups_activity_visibility', $html );