Skip to:
Content

BuddyPress.org

Changeset 7713


Ignore:
Timestamp:
12/23/2013 06:28:04 PM (11 years ago)
Author:
johnjamesjacoby
Message:

In bp_notifications_get_registered_components(), loop through active components looking for notification_callback and only include components that actually touch Notifications. See #5300. (1.9 branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.9/bp-notifications/bp-notifications-functions.php

    r7712 r7713  
    519519function bp_notifications_get_registered_components() {
    520520
     521    // Load BuddyPress
     522    $bp = buddypress();
     523
     524    // Setup return value
     525    $component_names = array();
     526
    521527    // Get the active components
    522     $active_components = buddypress()->active_components;
    523 
    524     // Get the component ID's from the active_components array
    525     $component_names   = array_keys( $active_components );
     528    $active_components = array_keys( $bp->active_components );
     529
     530    // Loop through components, look for callbacks, add to return value
     531    foreach ( $active_components as $component ) {
     532        if ( !empty( $bp->$component->notification_callback ) ) {
     533            $component_names[] = $component;
     534        }
     535    }
    526536
    527537    // Return active components with registered notifications callbacks
    528     return apply_filters( 'bp_notifications_get_component_names', $component_names );
    529 }
     538    return apply_filters( 'bp_notifications_get_component_names', $component_names, $active_components );
     539}
Note: See TracChangeset for help on using the changeset viewer.