Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/17/2015 03:58:30 PM (9 years ago)
Author:
dcavins
Message:

Allow plugins to format xprofile-related notifications.

Adds a hook so that plugins may generate
xprofile-related notifications (with the
component_name of xprofile) and
format those notification using a
dynamic filter based on the name
of the component_action.

Fixes #6663.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-notifications/bp-notifications-functions.php

    r10138 r10284  
    201201    foreach ( $grouped_notifications as $component_name => $action_arrays ) {
    202202
     203        // We prefer that extended profile component-related notifications use
     204        // the component_name of 'xprofile'. However, the extended profile child
     205        // object in the $bp object is keyed as 'profile', which is where we need
     206        // to look for the registered notification callback.
     207        if ( 'xprofile' == $component_name ) {
     208            $component_name = 'profile';
     209        }
     210
    203211        // Skip if group is empty
    204212        if ( empty( $action_arrays ) ) {
     
    612620            $component_names[] = $component;
    613621        }
     622        // The extended profile component is identified in the active_components array as 'xprofile'.
     623        // However, the extended profile child object has the key 'profile' in the $bp object.
     624        if ( 'xprofile' == $component && ! empty( $bp->profile->notification_callback ) ) {
     625            $component_names[] = $component;
     626        }
    614627    }
    615628
Note: See TracChangeset for help on using the changeset viewer.