Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/13/2015 01:35:21 AM (11 years ago)
Author:
tw2113
Message:

Adds hooks documentation to the BP-Notifications component.

Fixes #5946.

File:
1 edited

Legend:

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

    r9351 r9352  
    152152    }
    153153
    154     // Filter and return
     154    /**
     155     * Filters all notifications for a user.
     156     *
     157     * @since BuddyPress (2.1.0)
     158     *
     159     * @param array $notifications Array of notifications for user.
     160     * @param int   $user_id       ID of the user being fetched.
     161     */
    155162    return apply_filters( 'bp_notifications_get_all_notifications_for_user', $notifications, $user_id );
    156163}
     
    262269                if ( 'object' === $format ) {
    263270
    264                     // Retrieve the content of the notification using the callback
     271                    /**
     272                     * Filters the notifications for a user.
     273                     *
     274                     * @since BuddyPress (1.9.0)
     275                     *
     276                     * @param array $ref_array Array of properties for the current notification being rendered.
     277                     */
    265278                    $content = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', $ref_array );
    266279
     
    282295                // Return an array of content strings
    283296                } else {
     297
     298                    /** This filters is documented in bp-notifications/bp-notifications-functions.php */
    284299                    $renderable[] = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', $ref_array );
    285300                }
     
    293308    }
    294309
    295     // Filter and return
     310    /**
     311     * Filters the final array of notifications to be displayed for a user.
     312     *
     313     * @since BuddyPress (1.6.0)
     314     *
     315     * @param Array|Bool $renderable Array of notifications to render or false if no notifications.
     316     * @param int        $user_id    ID of the user whose notifications are being displayed.
     317     * @param string     $format     Display format requested for the notifications.
     318     */
    296319    return apply_filters( 'bp_core_get_notifications_for_user', $renderable, $user_id, $format );
    297320}
     
    541564    $count         = ! empty( $notifications ) ? count( $notifications ) : 0;
    542565
     566    /**
     567     * Filters the count of unread notification items for a user.
     568     *
     569     * @since BuddyPress (1.9.0)
     570     *
     571     * @param int $count Count of unread notification items for a user.
     572     */
    543573    return apply_filters( 'bp_notifications_get_total_notification_count', (int) $count );
    544574}
     
    572602    }
    573603
    574     // Return active components with registered notifications callbacks
     604    /**
     605     * Filters active components with registered notifications callbacks.
     606     *
     607     * @since BuddyPress (1.9.1)
     608     *
     609     * @param array $component_names   Array of registered component names.
     610     * @param array $active_components Array of active components.
     611     */
    575612    return apply_filters( 'bp_notifications_get_registered_components', $component_names, $active_components );
    576613}
Note: See TracChangeset for help on using the changeset viewer.