Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/25/2021 12:30:33 AM (2 years ago)
Author:
dcavins
Message:

Declare invitations as feature of groups component.

Centralize the logic which determines whether
group invitations are active by declaring
invitations as a feature of the groups
component. This also makes it easy for
developers to filter that value using the
bp_is_groups_invitations_active filter hook.

Props imath.

Fixes #8550.

File:
1 edited

Legend:

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

    r13094 r13156  
    260260                'position'    => 10,
    261261            ),
    262             'invites' => array(
    263                 'name'        => _x( 'Invite', 'My Group screen nav', 'buddypress' ),
    264                 'slug'        => 'send-invites',
    265                 'parent_slug' => $this->group->slug,
    266                 'position'    => 70,
    267             ),
    268262            'manage'  => array(
    269263                'name'        => _x( 'Manage', 'My Group screen nav', 'buddypress' ),
     
    273267            ),
    274268        );
     269
     270        if ( bp_is_active( 'groups', 'invitations' ) ) {
     271            $nav_items['invites'] = array(
     272                'name'        => _x( 'Invite', 'My Group screen nav', 'buddypress' ),
     273                'slug'        => 'send-invites',
     274                'parent_slug' => $this->group->slug,
     275                'position'    => 70,
     276            );
     277        }
    275278
    276279        // Make sure only global front.php will be checked.
Note: See TracChangeset for help on using the changeset viewer.