Ticket #5266: 5266.01.patch
File 5266.01.patch, 25.2 KB (added by , 12 years ago) |
---|
-
bp-activity/bp-activity-notifications.php
if ( !defined( 'ABSPATH' ) ) exit; 15 15 * 16 16 * @since BuddyPress (1.2) 17 17 * 18 * @uses bp_ core_add_notification()18 * @uses bp_notifications_add_notification() 19 19 * @uses bp_get_user_meta() 20 20 * @uses bp_core_get_user_displayname() 21 21 * @uses bp_activity_get_permalink() … … function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) 55 55 $content = ''; 56 56 57 57 // Add the BP notification 58 bp_core_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id ); 58 if ( bp_is_active( 'notifications' ) ) { 59 bp_notifications_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id ); 60 } 59 61 60 62 // Now email the user with the contents of the message (if they have enabled email notifications) 61 63 if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) { -
bp-activity/bp-activity-screens.php
function bp_activity_screen_mentions() { 133 133 * 134 134 * @since BuddyPress (1.5) 135 135 * 136 * @uses bp_ core_mark_all_notifications_by_type()136 * @uses bp_notifications_mark_all_notifications_by_type() 137 137 */ 138 138 function bp_activity_remove_screen_notifications() { 139 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); 139 if ( bp_is_active( 'notifications' ) ) { 140 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); 141 } 140 142 } 141 143 add_action( 'bp_activity_screen_my_activity', 'bp_activity_remove_screen_notifications' ); 142 144 add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications' ); -
bp-friends/bp-friends-cache.php
function friends_clear_friend_object_cache( $friendship_id ) { 32 32 * Clear friend-related notifications when ?new=1. 33 33 */ 34 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' );35 if ( isset( $_GET['new'] ) && bp_is_active( 'notifications' ) ) { 36 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' ); 37 37 } 38 38 } 39 39 add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' ); -
bp-friends/bp-friends-functions.php
function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = 49 49 50 50 if ( !$force_accept ) { 51 51 // Add the on screen notification 52 bp_core_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' ); 52 if ( bp_is_active( 'notifications' ) ) { 53 bp_notifications_add_notification( $friendship->initiator_user_id, $friendship->friend_user_id, $bp->friends->id, 'friendship_request' ); 54 } 53 55 54 56 // Send the email notification 55 57 friends_notification_new_request( $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id ); … … function friends_accept_friendship( $friendship_id ) { 118 120 if ( !$friendship->is_confirmed && BP_Friends_Friendship::accept( $friendship_id ) ) { 119 121 friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id ); 120 122 121 // Remove the friend request notice 122 bp_core_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 123 if ( bp_is_active( 'notifications' ) ) { 124 // Remove the friend request notice 125 bp_notifications_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 123 126 124 // Add a friend accepted notice for the initiating user 125 bp_core_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_accepted' ); 127 // Add a friend accepted notice for the initiating user 128 bp_notifications_add_notification( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_accepted' ); 129 } 126 130 127 131 $initiator_link = bp_core_get_userlink( $friendship->initiator_user_id ); 128 132 $friend_link = bp_core_get_userlink( $friendship->friend_user_id ); … … function friends_reject_friendship( $friendship_id ) { 171 175 if ( !$friendship->is_confirmed && BP_Friends_Friendship::reject( $friendship_id ) ) { 172 176 173 177 // Remove the friend request notice 174 bp_core_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 178 if ( bp_is_active( 'notifications' ) ) { 179 bp_notifications_mark_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 180 } 175 181 176 182 do_action_ref_array( 'friends_friendship_rejected', array( $friendship_id, &$friendship ) ); 177 183 return true; … … function friends_withdraw_friendship( $initiator_userid, $friend_userid ) { 196 202 197 203 if ( !$friendship->is_confirmed && BP_Friends_Friendship::withdraw( $friendship_id ) ) { 198 204 // Remove the friend request notice 199 bp_core_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 205 if ( bp_is_active( 'notifications' ) ) { 206 bp_notifications_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); 207 } 200 208 201 209 do_action_ref_array( 'friends_friendship_whithdrawn', array( $friendship_id, &$friendship ) ); 202 210 return true; … … function friends_remove_data( $user_id ) { 576 584 bp_delete_user_meta( $user_id, 'total_friend_count' ); 577 585 578 586 // Remove friendship requests FROM user 579 bp_core_delete_notifications_from_user( $user_id, $bp->friends->id, 'friendship_request' ); 587 if ( bp_is_active( 'notifications' ) ) { 588 bp_notifications_delete_notifications_from_user( $user_id, $bp->friends->id, 'friendship_request' ); 589 } 580 590 581 591 do_action( 'friends_remove_data', $user_id ); 582 592 } -
bp-friends/bp-friends-screens.php
if ( !defined( 'ABSPATH' ) ) exit; 20 20 function friends_screen_my_friends() { 21 21 22 22 // Delete any friendship acceptance notifications for the user when viewing a profile 23 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' ); 23 if ( bp_is_active( 'notifications' ) ) { 24 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_accepted' ); 25 } 24 26 25 27 do_action( 'friends_screen_my_friends' ); 26 28 … … function friends_screen_requests() { 67 69 68 70 do_action( 'friends_screen_requests' ); 69 71 70 if ( isset( $_GET['new'] ) ) {71 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_request' );72 if ( isset( $_GET['new'] ) && bp_is_active( 'notifications' ) ) { 73 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->friends->id, 'friendship_request' ); 72 74 } 73 75 74 76 bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) ); -
bp-groups/bp-groups-functions.php
function groups_delete_group( $group_id ) { 217 217 groups_delete_all_group_invites( $group_id ); 218 218 219 219 // Remove all notifications for any user belonging to this group 220 bp_core_delete_all_notifications_by_type( $group_id, $bp->groups->id ); 220 if ( bp_is_active( 'notifications' ) ) { 221 bp_notifications_delete_all_notifications_by_type( $group_id, $bp->groups->id ); 222 } 221 223 222 224 do_action( 'groups_delete_group', $group_id); 223 225 … … function groups_accept_invite( $user_id, $group_id ) { 718 720 // Modify group meta 719 721 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 720 722 721 bp_core_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' ); 723 if ( bp_is_active( 'notifications' ) ) { 724 bp_notifications_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' ); 725 } 722 726 723 727 do_action( 'groups_accept_invite', $user_id, $group_id ); 724 728 return true; … … function groups_delete_invite( $user_id, $group_id ) { 737 741 738 742 $delete = BP_Groups_Member::delete_invite( $user_id, $group_id ); 739 743 740 if ( !empty( $delete ) ) {741 bp_ core_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' );744 if ( !empty( $delete ) && bp_is_active( 'notifications' ) ) { 745 bp_notifications_mark_notifications_by_item_id( $user_id, $group_id, buddypress()->groups->id, 'group_invite' ); 742 746 } 743 747 744 748 return $delete; … … function groups_remove_data_for_user( $user_id ) { 1078 1082 1079 1083 BP_Groups_Member::delete_all_for_user( $user_id ); 1080 1084 1081 bp_core_delete_notifications_from_user( $user_id, $bp->groups->id, 'new_membership_request' ); 1085 if ( bp_is_active( 'notifications' ) ) { 1086 bp_notifications_delete_notifications_from_user( $user_id, $bp->groups->id, 'new_membership_request' ); 1087 } 1082 1088 1083 1089 do_action( 'groups_remove_data_for_user', $user_id ); 1084 1090 } -
bp-groups/bp-groups-notifications.php
To view the group: %2$s 56 56 57 57 function groups_notification_new_membership_request( $requesting_user_id, $admin_id, $group_id, $membership_id ) { 58 58 59 bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id ); 59 if ( bp_is_active( 'notifications' ) ) { 60 bp_notifications_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id ); 61 } 60 62 61 63 if ( 'no' == bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) ) 62 64 return false; … … To view %4$s\'s profile: %5$s 105 107 function groups_notification_membership_request_completed( $requesting_user_id, $group_id, $accepted = true ) { 106 108 107 109 // Post a screen notification first. 108 if ( $accepted ) 109 bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_accepted' ); 110 else 111 bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' ); 110 if ( bp_is_active( 'notifications' ) ) { 111 if ( $accepted ) { 112 bp_notifications_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_accepted' ); 113 } else { 114 bp_notifications_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' ); 115 } 116 } 112 117 113 118 if ( 'no' == bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) ) 114 119 return false; … … function groups_notification_promoted_member( $user_id, $group_id ) { 171 176 } 172 177 173 178 // Post a screen notification first. 174 bp_core_add_notification( $group_id, $user_id, 'groups', $type ); 179 if ( bp_is_active( 'notifications' ) ) { 180 bp_notifications_add_notification( $group_id, $user_id, 'groups', $type ); 181 } 175 182 176 183 if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) ) 177 184 return false; … … function groups_notification_group_invites( &$group, &$member, $inviter_user_id 222 229 $invited_user_id = $member->user_id; 223 230 224 231 // Post a screen notification first. 225 bp_core_add_notification( $group->id, $invited_user_id, 'groups', 'group_invite' ); 232 if ( bp_is_active( 'notifications' ) ) { 233 bp_notifications_add_notification( $group->id, $invited_user_id, 'groups', 'group_invite' ); 234 } 226 235 227 236 if ( 'no' == bp_get_user_meta( $invited_user_id, 'notification_groups_invite', true ) ) 228 237 return false; -
bp-groups/bp-groups-screens.php
function groups_screen_my_groups() { 30 30 $bp = buddypress(); 31 31 32 32 // Delete group request notifications for the user 33 if ( isset( $_GET['n'] ) ) {34 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );35 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );36 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' );37 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' );33 if ( isset( $_GET['n'] ) && bp_is_active( 'notifications' ) ) { 34 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' ); 35 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' ); 36 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' ); 37 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' ); 38 38 } 39 39 40 40 do_action( 'groups_screen_my_groups' ); … … function groups_screen_group_invites() { 94 94 } 95 95 96 96 // Remove notifications 97 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'group_invite' ); 97 if ( bp_is_active( 'notifications' ) ) { 98 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->groups->id, 'group_invite' ); 99 } 98 100 99 101 do_action( 'groups_screen_group_invites', $group_id ); 100 102 … … function groups_screen_group_home() { 108 110 109 111 $bp = buddypress(); 110 112 111 if ( isset( $_GET['n'] ) ) {112 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' );113 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' );114 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' );115 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' );113 if ( isset( $_GET['n'] ) && bp_is_active( 'notifications' ) ) { 114 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' ); 115 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' ); 116 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' ); 117 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' ); 116 118 } 117 119 118 120 do_action( 'groups_screen_group_home' ); … … function groups_screen_group_admin_requests() { 813 815 return false; 814 816 815 817 // Remove any screen notifications 816 bp_core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' ); 818 if ( bp_is_active( 'notifications' ) ) { 819 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' ); 820 } 817 821 818 822 $request_action = (string)bp_action_variable( 1 ); 819 823 $membership_id = (int)bp_action_variable( 2 ); -
bp-members/bp-members-notifications.php
if ( !defined( 'ABSPATH' ) ) exit; 16 16 /** 17 17 * Add a notification for a specific user, from a specific component 18 18 * 19 * @deprecated Deprecated since BuddyPress 1.9.0. Use 20 * bp_notifications_add_notification() instead. 21 * 19 22 * @since BuddyPress (1.0) 20 23 * @param string $item_id 21 24 * @param int $user_id … … function bp_core_add_notification( $item_id, $user_id, $component_name, $compone 53 56 /** 54 57 * Delete a specific notification by its ID 55 58 * 59 * @deprecated Deprecated since BuddyPress 1.9.0. Use 60 * bp_notifications_delete_notification() instead. 61 * 56 62 * @since BuddyPress (1.0) 57 63 * @param int $id 58 64 * @return boolean True on success, false on fail … … function bp_core_delete_notification( $id ) { 70 76 /** 71 77 * Get a specific notification by its ID 72 78 * 79 * @deprecated Deprecated since BuddyPress 1.9.0. Use 80 * bp_notifications_get_notification() instead. 81 * 73 82 * @since BuddyPress (1.0) 74 83 * @param int $id 75 84 * @return BP_Core_Notification … … function bp_core_get_notification( $id ) { 87 96 /** 88 97 * Get notifications for a specific user 89 98 * 99 * @deprecated Deprecated since BuddyPress 1.9.0. Use 100 * bp_notifications_get_notifications_for_user() instead. 101 * 90 102 * @since BuddyPress (1.0) 91 103 * @global BuddyPress $bp 92 104 * @param int $user_id … … function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) { 113 125 * Used when clearing out notifications for a specific component when the user 114 126 * has visited that component. 115 127 * 128 * @deprecated Deprecated since BuddyPress 1.9.0. Use 129 * bp_notifications_delete_notifications_by_type() instead. 130 * 116 131 * @since BuddyPress (1.0) 117 132 * @param int $user_id 118 133 * @param string $component_name … … function bp_core_delete_notifications_by_type( $user_id, $component_name, $compo 135 150 * Used when clearing out notifications for a specific component when the user 136 151 * has visited that component. 137 152 * 153 * @deprecated Deprecated since BuddyPress 1.9.0. Use 154 * bp_notifications_delete_notifications_by_item_id() instead. 155 * 138 156 * @since BuddyPress (1.0) 139 157 * @param int $user_id 140 158 * @param string $component_name … … function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component 154 172 /** 155 173 * Delete all notifications for by type 156 174 * 175 * @deprecated Deprecated since BuddyPress 1.9.0. Use 176 * bp_notifications_delete_all_notifications_by_type() instead. 177 * 157 178 * @since BuddyPress (1.0) 158 179 * @param int $user_id 159 180 * @param string $component_name … … function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $c 175 196 * 176 197 * Used when clearing out all notifications for a user, whene deleted or spammed 177 198 * 199 * @deprecated Deprecated since BuddyPress 1.9.0. Use 200 * bp_notifications_delete_notifications_from_user() instead. 201 * 178 202 * @since BuddyPress (1.0) 179 203 * @param int $user_id 180 204 * @param string $component_name … … function bp_core_delete_notifications_from_user( $user_id, $component_name, $com 191 215 return bp_notifications_delete_notifications_from_user( $user_id, $component_name, $component_action ); 192 216 } 193 217 194 /** Mark **********************************************************************/195 196 /**197 * Delete notifications for a user by type198 *199 * Used when clearing out notifications for a specific component when the user200 * has visited that component.201 *202 * @since BuddyPress (1.9.0)203 * @param int $user_id204 * @param string $component_name205 * @param string $component_action206 * @param int $is_new207 * @return boolean True on success, false on fail208 */209 function bp_core_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new = false ) {210 211 // Bail if notifications is not active212 if ( ! bp_is_active( 'notifications' ) ) {213 return false;214 }215 216 return bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new );217 }218 219 /**220 * Delete notifications for an item ID221 *222 * Used when clearing out notifications for a specific component when the user223 * has visited that component.224 *225 * @since BuddyPress (1.9.0)226 * @param int $user_id227 * @param string $component_name228 * @param string $component_action229 * @param int $is_new230 * @return boolean True on success, false on fail231 */232 function bp_core_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false, $is_new = false ) {233 234 // Bail if notifications is not active235 if ( ! bp_is_active( 'notifications' ) ) {236 return false;237 }238 239 return bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id, $is_new );240 }241 242 /**243 * Mark all notifications read/unread for by type244 *245 * Used when clearing out notifications for an entire component246 *247 * @since BuddyPress (1.9.0)248 * @param int $user_id249 * @param string $component_name250 * @param string $component_action251 * @return boolean True on success, false on fail252 */253 function bp_core_mark_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false, $is_new = false ) {254 255 // Bail if notifications is not active256 if ( ! bp_is_active( 'notifications' ) ) {257 return false;258 }259 260 bp_notifications_mark_all_notifications_by_type( $item_id, $component_name, $component_action, $secondary_item_id, $is_new );261 }262 263 /**264 * Mark all notifications read/unread from a user265 *266 * @since BuddyPress (1.9.0)267 * @param int $user_id268 * @param string $component_name269 * @param string $component_action270 * @return boolean True on success, false on fail271 */272 function bp_core_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new = false ) {273 274 // Bail if notifications is not active275 if ( ! bp_is_active( 'notifications' ) ) {276 return false;277 }278 279 return bp_notifications_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new );280 }281 282 218 /** Helpers *******************************************************************/ 283 219 284 220 /** … … function bp_core_mark_notifications_from_user( $user_id, $component_name, $compo 286 222 * 287 223 * Used before deleting a notification for a user 288 224 * 225 * @deprecated Deprecated since BuddyPress 1.9.0. Use 226 * bp_notifications_check_notification_access() instead. 227 * 289 228 * @since BuddyPress (1.0) 290 229 * @param int $user_id 291 230 * @param int $notification_id -
bp-messages/bp-messages-functions.php
function messages_new_message( $args = '' ) { 116 116 if ( $message->send() ) { 117 117 118 118 // Send screen notifications to the recipients 119 foreach ( (array) $message->recipients as $recipient ) { 120 bp_core_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message', $message->sender_id ); 119 if ( bp_is_active( 'notifications' ) ) { 120 foreach ( (array) $message->recipients as $recipient ) { 121 bp_notifications_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message', $message->sender_id ); 122 } 121 123 } 122 124 123 125 // Send email notifications to the recipients -
bp-messages/bp-messages-template.php
function bp_has_message_threads( $args = '' ) { 184 184 if ( bp_is_current_action( 'notices' ) && !bp_current_user_can( 'bp_moderate' ) ) { 185 185 wp_redirect( bp_displayed_user_id() ); 186 186 } else { 187 if ( bp_is_current_action( 'inbox' ) ) {188 bp_ core_mark_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' );187 if ( bp_is_current_action( 'inbox' ) && bp_is_active( 'notifications' ) ) { 188 bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' ); 189 189 } 190 190 191 191 if ( bp_is_current_action( 'sentbox' ) ) { -
bp-notifications/bp-notifications-adminbar.php
function bp_notifications_toolbar_menu() { 24 24 return false; 25 25 } 26 26 27 $notifications = bp_ core_get_notifications_for_user( bp_loggedin_user_id(), 'object' );27 $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id(), 'object' ); 28 28 $count = ! empty( $notifications ) ? count( $notifications ) : 0; 29 29 $alert_class = (int) $count > 0 ? 'pending-count alert' : 'count no-alert'; 30 30 $menu_title = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . $count . '</span>'; -
bp-notifications/bp-notifications-buddybar.php
function bp_notifications_buddybar_menu() { 27 27 echo '<li id="bp-adminbar-notifications-menu"><a href="' . bp_loggedin_user_domain() . '">'; 28 28 _e( 'Notifications', 'buddypress' ); 29 29 30 if ( $notifications = bp_ core_get_notifications_for_user( bp_loggedin_user_id() ) ) : ?>30 if ( $notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() ) ) : ?> 31 31 <span><?php echo count( $notifications ) ?></span> 32 32 <?php 33 33 endif;