Skip to:
Content

BuddyPress.org

Changeset 12597


Ignore:
Timestamp:
03/28/2020 07:06:15 PM (6 years ago)
Author:
imath
Message:

BP Friends: improve the filter of the formatting notification function

Add the $secondary_item_id parameter to the following dynamic filter:
bp_friends_{$amount}_friendship_{$action}_notification

Props bhargavbhandari90, dcavins, espellcaste

Fixes #8136

File:
1 edited

Legend:

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

    r12589 r12597  
    8383                 *
    8484                 * @since 1.0.0
     85                 * @since 6.0.0 Adds the $secondary_item_id parameter.
    8586                 *
    86                  * @param string|array $value       Depending on format, an HTML link to new requests profile
    87                  *                                  tab or array with link and text.
    88                  * @param int          $total_items The total number of messaging-related notifications
    89                  *                                  waiting for the user.
    90                  * @param int          $item_id     The primary item ID.
     87                 * @param string|array $value             Depending on format, an HTML link to new requests profile tab or array with link and text.
     88                 * @param int          $total_items       The total number of messaging-related notifications waiting for the user.
     89                 * @param int          $item_id           The primary item ID.
     90                 * @param int          $secondary_item_id The secondary item ID.
    9191                 */
    92                 $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id );
     92                $return = apply_filters( 'bp_friends_' . $amount . '_friendship_' . $action . '_notification', '<a href="' . esc_url( $link ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $item_id, $secondary_item_id );
    9393        } else {
    9494                /** This filter is documented in bp-friends/bp-friends-notifications.php */
     
    9696                        'link' => $link,
    9797                        'text' => $text
    98                 ), (int) $total_items, $item_id );
     98                ), (int) $total_items, $item_id, $secondary_item_id );
    9999        }
    100100
Note: See TracChangeset for help on using the changeset viewer.