Skip to:
Content

BuddyPress.org

Changeset 9970


Ignore:
Timestamp:
06/27/2015 02:49:13 AM (11 years ago)
Author:
dcavins
Message:

Add filter in groups_format_notifications().

Allow plugins to filter unmatched component
actions in group-related notification. Changeset
adds a dynamically named filter based on the name
of the component action.

Fixes #6515.

File:
1 edited

Legend:

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

    r9906 r9970  
    11681168
    11691169                        break;
     1170
     1171                default:
     1172
     1173                        /**
     1174                         * Filters plugin-added group-related custom component_actions.
     1175                         *
     1176                         * @since BuddyPress (2.4.0)
     1177                         *
     1178                         * @param string $notification      Null value.
     1179                         * @param int    $item_id           The primary item ID.
     1180                         * @param int    $secondary_item_id The secondary item ID.
     1181                         * @param int    $total_items       The total number of messaging-related notifications
     1182                         *                                  waiting for the user.
     1183                         * @param string $format            'string' for BuddyBar-compatible notifications;
     1184                         *                                  'array' for WP Toolbar.
     1185                         */
     1186                        $custom_action_notification = apply_filters( 'bp_groups_' . $action . '_notification', null, $item_id, $secondary_item_id, $total_items, $format );
     1187
     1188                        if ( ! is_null( $custom_action_notification ) ) {
     1189                                return $custom_action_notification;
     1190                        }
     1191
     1192                        break;
    11701193        }
    11711194
Note: See TracChangeset for help on using the changeset viewer.