Skip to:
Content

BuddyPress.org

Changeset 10284


Ignore:
Timestamp:
10/17/2015 03:58:30 PM (5 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.

Location:
trunk/src
Files:
1 added
2 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
  • trunk/src/bp-xprofile/bp-xprofile-loader.php

    r10198 r10284  
    6868            'template',
    6969            'functions',
     70            'notifications',
    7071        );
    7172
Note: See TracChangeset for help on using the changeset viewer.