bp_activity_privacy_member_latest_update

The BuddyPress Activity Privacy bp activity privacy member latest update function.

Description

bp_activity_privacy_member_latest_update( $update_content ); 

Parameters (1)

0. $update_content
The update content.

Usage

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

Defined (1)

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

/includes/bp-activity-privacy-filters.php  
  1. function bp_activity_privacy_member_latest_update( $update_content ) { 
  2. $is_super_admin = is_super_admin(); 
  3. return $update_content; 
  4.  
  5. global $members_template; 
  6. $latest_update = bp_get_user_meta( bp_get_member_user_id(), 'bp_latest_update' , true ); 
  7. if ( !empty( $latest_update ) ) { 
  8. $activity_id = $latest_update['id']; 
  9. $activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id ) ); 
  10.  
  11. // single out the activity 
  12. $activity = $activities["activities"][0]; 
  13.  
  14. /** 
  15. $has_activities = false; 
  16. $activities = new stdClass(); 
  17. $activities->activities = array(); 
  18. $activities->activities[] = $activity; 
  19.   
  20. bp_visibility_activity_filter( $has_activities, $activities ); 
  21. if ( empty( $activities->activities ) ) 
  22. return ''; 
  23. */ 
  24.  
  25. $bp_displayed_user_id = bp_displayed_user_id(); 
  26. $bp_loggedin_user_id = bp_loggedin_user_id(); 
  27.  
  28. $remove_from_stream = bp_visibility_is_activity_invisible( $activity, $bp_loggedin_user_id, $is_super_admin ); 
  29.  
  30. if ($remove_from_stream)  
  31. return false; 
  32.  
  33. return $update_content;