Skip to:
Content

BuddyPress.org

Changeset 12979


Ignore:
Timestamp:
06/30/2021 01:36:18 AM (5 years ago)
Author:
imath
Message:

Pass expected arguments to Members/Groups Action button filters

To improve extensibility of the 2 functions BP Nouveau uses to generate these action buttons (bp_nouveau_get_members_buttons() & bp_nouveau_get_groups_buttons()), we are adding a new $args parameter to their corresponding filters ('bp_nouveau_get_members_buttons'& 'bp_nouveau_get_groups_buttons').

Doing so should help developers to have better information about the expected output for these buttons.

Props sbrajesh

Fixes #8497

Location:
trunk/src/bp-templates/bp-nouveau/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/groups/template-tags.php

    r12789 r12979  
    44 *
    55 * @since 3.0.0
    6  * @version 6.0.0
     6 * @version 9.0.0
    77 */
    88
     
    10071007                 *
    10081008                 * @since 3.0.0
     1009                 * @since 9.0.0 Adds the `$args` parameter to the filter.
    10091010                 *
    10101011                 * @param array  $buttons The list of buttons.
    10111012                 * @param int    $group   The current group object.
    10121013                 * @param string $type    Whether we're displaying a groups loop or a groups single item.
     1014                 * @param array  $args    Button arguments.
    10131015                 */
    1014                 $buttons_group = apply_filters( 'bp_nouveau_get_groups_buttons', $buttons, $group, $type );
     1016                $buttons_group = apply_filters( 'bp_nouveau_get_groups_buttons', $buttons, $group, $type, $args );
    10151017
    10161018                if ( ! $buttons_group ) {
  • trunk/src/bp-templates/bp-nouveau/includes/members/template-tags.php

    r12921 r12979  
    44 *
    55 * @since 3.0.0
    6  * @version 8.0.0
     6 * @version 9.0.0
    77 */
    88
     
    467467                 *
    468468                 * @since 3.0.0
     469                 * @since 9.0.0 Adds the `$args` parameter to the filter.
    469470                 *
    470471                 * @param array  $buttons The list of buttons.
    471472                 * @param int    $user_id The displayed user ID.
    472473                 * @param string $type    Whether we're displaying a members loop or a user's page
    473                  */
    474                 $buttons_group = apply_filters( 'bp_nouveau_get_members_buttons', $buttons, $user_id, $type );
     474                 * @param array  $args    Button arguments.
     475                 */
     476                $buttons_group = apply_filters( 'bp_nouveau_get_members_buttons', $buttons, $user_id, $type, $args );
    475477                if ( ! $buttons_group ) {
    476478                        return $buttons;
Note: See TracChangeset for help on using the changeset viewer.