bp_activity_remove_screen_notifications_for_non_mentions

Mark non-mention notifications as read when user visits our read permalink.

Description

bp_activity_remove_screen_notifications_for_non_mentions(); 

In particular, update_reply and comment_reply notifications are handled here. See for more info.


Usage

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

Defined (1)

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

/bp-activity/bp-activity-notifications.php  
  1. function bp_activity_remove_screen_notifications_for_non_mentions() { 
  2. if ( false === is_singular() || false === is_user_logged_in() || empty( $_GET['nid'] ) ) { 
  3. return; 
  4.  
  5. // Mark notification as read. 
  6. array( 
  7. 'is_new' => false 
  8. ),  
  9. array( 
  10. 'user_id' => bp_loggedin_user_id(),  
  11. 'id' => (int) $_GET['nid'] 
  12. );