bp_activitiy_privacy_activity_visibility_meta

The BuddyPress Activity Privacy bp activitiy privacy activity visibility meta function.

Description

bp_activitiy_privacy_activity_visibility_meta( $content ); 

Parameters (1)

0. $content
The content.

Usage

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

Defined (1)

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

/includes/bp-activity-privacy-actions.php  
  1. function bp_activitiy_privacy_activity_visibility_meta( $content ) { 
  2. $is_super_admin = is_super_admin(); 
  3. if( ($is_super_admin && bp_ap_is_admin_allowed_to_view_edit_privacy_levels() ) ||  
  4. (bp_activity_user_can_delete() && bp_ap_is_members_allowed_to_edit_privacy_levels() ) ||  
  5. !bp_ap_show_privacy_in_activity_meta() ) { 
  6. return $content; 
  7.  
  8. } else { 
  9. $group_id = bp_get_activity_item_id(); 
  10.  
  11. //if is not a group activity or a new blog post 
  12. if( !isset( $group_id ) || $group_id == 0 || 'new_blog_post' == bp_get_activity_type() ) 
  13. $visibility_levels = bp_get_profile_activity_visibility_levels();  
  14. else 
  15. $visibility_levels = bp_get_groups_activity_visibility_levels(); 
  16.  
  17. global $bp; 
  18. $default_visibility = 'public'; 
  19. $visibility = bp_activity_get_meta( bp_get_activity_id(), 'activity-privacy' ); 
  20.  
  21.  
  22. if(!isset($visibility) || strlen($visibility) == 0) 
  23. $visibility = $default_visibility; 
  24.  
  25. $visibility_label = ''; 
  26. if(!bp_ap_is_use_fontawsome()) { 
  27. $visibility_label = $visibility_levels[$visibility]['label']; 
  28.  
  29. $html = ' · <i title="'. $visibility_levels[$visibility]['label'] .'" class="bp-activity-visibility fa fa-' . $visibility .'">' . $visibility_label .'</i>'; 
  30. $content .= $html; 
  31. return $content;