Skip to:
Content

BuddyPress.org

Ticket #6515: 6515.02.patch

File 6515.02.patch, 1.2 KB (added by dcavins, 11 years ago)

Allow plugins to filter unmatched component_actions in group-related notification.

  • src/bp-groups/bp-groups-notifications.php

    diff --git src/bp-groups/bp-groups-notifications.php src/bp-groups/bp-groups-notifications.php
    index 3bd75d7..911f17f 100644
    function groups_format_notifications( $action, $item_id, $secondary_item_id, $to 
    11671167                        }
    11681168
    11691169                        break;
     1170                default:
     1171
     1172                        /**
     1173                         * Filters plugin-added group-related custom component_actions.
     1174                         *
     1175                         * @since BuddyPress (2.4.0)
     1176                         *
     1177                         * @param string $notification      Null value.
     1178                         * @param int    $item_id           The primary item ID.
     1179                         * @param int    $secondary_item_id The secondary item ID.
     1180                         * @param int    $total_items       The total number of messaging-related notifications
     1181                         *                                  waiting for the user.
     1182                         * @param string $format            'string' for BuddyBar-compatible notifications;
     1183                         *                                  'array' for WP Toolbar.
     1184                         */
     1185                        $custom_action_notification = apply_filters( 'bp_groups_' . $action . '_notification', null, $item_id, $secondary_item_id, $total_items, $format );
     1186
     1187                        if ( ! is_null( $custom_action_notification ) ) {
     1188                                return $custom_action_notification;
     1189                        }
     1190
     1191                        break;
    11701192        }
    11711193
    11721194        /**