Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/30/2013 03:47:27 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Refactor Friends component's approach to Notifications integration:

  • Relocate friends_clear_friendship_notifications() out of bp-friends-cache.php and into bp-friends-notifications.php
  • Introduce helper functions for handling the adding/marking/deleting of notifications. Hook these new functions into their respective actions rather than have them hardcoded and interspersed amongst the first-class code.
  • See #5266. Hat-tip r-a-y.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-cache.php

    r7556 r7619  
    1010 * @subpackage FriendsCaching
    1111 */
    12 
    1312
    1413// Exit if accessed directly
     
    2928}
    3029
    31 /**
    32  * Clear friend-related notifications when ?new=1.
    33  */
    34 function friends_clear_friend_notifications() {
    35     if ( isset( $_GET['new'] ) ) {
    36         bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' );
    37     }
    38 }
    39 add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
    40 
    4130// List actions to clear object caches on
    4231add_action( 'friends_friendship_accepted', 'friends_clear_friend_object_cache' );
Note: See TracChangeset for help on using the changeset viewer.