bp_activity_clear_new_mentions

Reset a user's unread mentions list and count.

Description

bp_activity_clear_new_mentions( (int) $user_id ); 

Parameters (1)

0. $user_id (int)
The id of the user whose unread mentions are being reset.

Usage

  1. if ( !function_exists( 'bp_activity_clear_new_mentions' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-activity/bp-activity-functions.php'; 
  3.  
  4. // The id of the user whose unread mentions are being reset. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_activity_clear_new_mentions($user_id); 
  9.  

Defined (1)

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

/bp-activity/bp-activity-functions.php  
  1. function bp_activity_clear_new_mentions( $user_id ) { 
  2. bp_delete_user_meta( $user_id, 'bp_new_mention_count' ); 
  3. bp_delete_user_meta( $user_id, 'bp_new_mentions' ); 
  4.  
  5. /** 
  6. * Fires once mentions has been reset for a given user. 
  7. * @since 2.5.0 
  8. * @param int $user_id The id of the user whose unread mentions are being reset. 
  9. */