Changeset 7832
- Timestamp:
- 02/08/2014 06:26:52 PM (11 years ago)
- Location:
- branches/1.9
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.9/bp-activity/bp-activity-notifications.php
r7622 r7832 337 337 338 338 /** 339 * Remove activity notifications when a user clicks on them.339 * Mark at-mention notifications as read when users visit their Mentions page. 340 340 * 341 341 * @since BuddyPress (1.5) … … 344 344 */ 345 345 function bp_activity_remove_screen_notifications() { 346 if ( bp_is_active( 'notifications' ) ) { 347 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); 348 } 349 } 350 add_action( 'bp_activity_screen_my_activity', 'bp_activity_remove_screen_notifications' ); 351 add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications' ); 352 add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notifications' ); 353 346 if ( ! bp_is_active( 'notifications' ) ) { 347 return; 348 } 349 350 // Only mark read if you're looking at your own mentions 351 if ( ! bp_is_my_profile() ) { 352 return; 353 } 354 355 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); 356 } 357 add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notifications' ); 358 359 /** 360 * Mark at-mention notification as read when user visits the activity with the mention. 361 * 362 * @since BuddyPress (2.0.0) 363 */ 364 function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) { 365 if ( ! bp_is_active( 'notifications' ) ) { 366 return; 367 } 368 369 if ( ! is_user_logged_in() ) { 370 return; 371 } 372 373 // Mark as read any notifications for the current user related to this 374 // activity item 375 bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), $activity->id, buddypress()->activity->id, 'new_at_mention' ); 376 } 377 add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications_single_activity_permalink' ); 378
Note: See TracChangeset
for help on using the changeset viewer.