Skip to:
Content

BuddyPress.org

Ticket #6997: 6997-bp-notifications-template.patch

File 6997-bp-notifications-template.patch, 2.0 KB (added by Offereins, 9 years ago)

Filter updates for bp-notifications-template.php

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

    diff --git a/src/bp-notifications/bp-notifications-template.php b/src/bp-notifications/bp-notifications-template.php
    index f9055ba..58f9ab2 100644
    a b function bp_has_notifications( $args = '' ) { 
    215215         * Filters whether or not the user has notifications to display.
    216216         *
    217217         * @since 1.9.0
     218         * @since 2.6.0 Added the `$r` parameter.
    218219         *
    219220         * @param bool                      $value      Whether or not there are notifications to display.
    220221         * @param BP_Notifications_Template $query_loop BP_Notifications_Template object instance.
     222         * @param array                     $r          Array of arguments passed into the BP_Notifications_Template class.
    221223         */
    222         return apply_filters( 'bp_has_notifications', $query_loop->has_notifications(), $query_loop );
     224        return apply_filters( 'bp_has_notifications', $query_loop->has_notifications(), $query_loop, $r );
    223225}
    224226
    225227/**
    function bp_the_notification_action_links( $args = '' ) { 
    826828                 * Filters the action links for the current notification.
    827829                 *
    828830                 * @since 1.9.0
     831                 * @since 2.6.0 Added the `$r` parameter.
    829832                 *
    830833                 * @param string $retval HTML links for actions to take on single notifications.
     834                 * @param array  $r      Array of parsed arguments.
    831835                 */
    832                 return apply_filters( 'bp_get_the_notification_action_links', $retval );
     836                return apply_filters( 'bp_get_the_notification_action_links', $retval, $r );
    833837        }
    834838
    835839/**
    function bp_notifications_sort_order_form() { 
    911915        $selected = 'DESC';
    912916
    913917        // Check for a custom sort_order.
    914         if ( !empty( $_REQUEST['sort_order'] ) ) {
     918        if ( ! empty( $_REQUEST['sort_order'] ) ) {
    915919                if ( in_array( $_REQUEST['sort_order'], $orders ) ) {
    916920                        $selected = $_REQUEST['sort_order'];
    917921                }
    function bp_notifications_sort_order_form() { 
    929933                        <input id="submit" type="submit" name="form-submit" class="submit" value="<?php esc_attr_e( 'Go', 'buddypress' ); ?>" />
    930934                </noscript>
    931935        </form>
    932 
    933 <?php
     936        <?php
    934937}
    935938
    936939/**