Changeset 7307
- Timestamp:
- 06/26/2025 12:32:48 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/extend/buddypress/notifications.php
r7184 r7307 207 207 if ( ! bbp_has_errors() ) { 208 208 209 // Default to nothing marked 210 $reply_marked = $topic_marked = $marked = false; 211 209 212 // Get these once 210 213 $post_type = bbp_get_reply_post_type(); 211 214 $component = bbp_get_component_name(); 212 213 // Attempt to clear notifications for this topic 214 $marked = bp_notifications_mark_notifications_by_type( $user_id, $component, 'bbp_new_reply_' . $topic_id ); 215 $c_action = 'bbp_new_reply_' . $topic_id; 215 216 216 217 // Get all reply IDs for the topic … … 223 224 foreach ( $replies as $reply_id ) { 224 225 225 // Attempt to mark notification for thisreply ID226 $ marked = bp_notifications_mark_notifications_by_item_id( $user_id, $reply_id, $component, 'bbp_new_reply');226 // Attempt to clear notification for this user & reply ID 227 $reply_marked = bp_notifications_mark_notifications_by_item_id( $user_id, $reply_id, $component, $c_action ); 227 228 228 229 // If marked, redirect to this reply ID 229 if ( ! empty( $ marked ) ) {230 if ( ! empty( $reply_marked ) ) { 230 231 $redirect_id = $reply_id; 231 232 } … … 233 234 } 234 235 236 // Attempt to clear notifications for this user & topic 237 $topic_marked = bp_notifications_mark_notifications_by_type( $user_id, $component, $c_action ); 238 239 // Maybe combine updated/marked rows 240 if ( is_numeric( $topic_marked ) || is_numeric( $reply_marked ) ) { 241 $marked = (int) $topic_marked + (int) $reply_marked; 242 } 243 235 244 // Do additional subscriptions actions 236 245 do_action( 'bbp_notifications_handler', $marked, $user_id, $topic_id, $action );
Note: See TracChangeset
for help on using the changeset viewer.