Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/25/2021 12:30:33 AM (3 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-legacy/buddypress/groups/create.php

    r12375 r13156  
    173173                <?php endif; ?>
    174174
    175                 <fieldset class="group-create-invitations">
    176 
    177                     <legend><?php _e( 'Group Invitations', 'buddypress' ); ?></legend>
    178 
    179                     <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
    180 
    181                     <div class="radio">
    182 
    183                         <label for="group-invite-status-members"><input type="radio" name="group-invite-status" id="group-invite-status-members" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> <?php _e( 'All group members', 'buddypress' ); ?></label>
    184 
    185                         <label for="group-invite-status-mods"><input type="radio" name="group-invite-status" id="group-invite-status-mods" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ); ?></label>
    186 
    187                         <label for="group-invite-status-admins"><input type="radio" name="group-invite-status" id="group-invite-status-admins" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> <?php _e( 'Group admins only', 'buddypress' ); ?></label>
    188 
    189                     </div>
    190 
    191                 </fieldset>
     175                <?php if ( bp_is_active( 'groups', 'invitations' ) ): ?>
     176
     177                    <fieldset class="group-create-invitations">
     178
     179                        <legend><?php _e( 'Group Invitations', 'buddypress' ); ?></legend>
     180
     181                        <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
     182
     183                        <div class="radio">
     184
     185                            <label for="group-invite-status-members"><input type="radio" name="group-invite-status" id="group-invite-status-members" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> <?php _e( 'All group members', 'buddypress' ); ?></label>
     186
     187                            <label for="group-invite-status-mods"><input type="radio" name="group-invite-status" id="group-invite-status-mods" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ); ?></label>
     188
     189                            <label for="group-invite-status-admins"><input type="radio" name="group-invite-status" id="group-invite-status-admins" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> <?php _e( 'Group admins only', 'buddypress' ); ?></label>
     190
     191                        </div>
     192
     193                    </fieldset>
     194
     195                <?php endif; ?>
    192196
    193197                <?php
Note: See TracChangeset for help on using the changeset viewer.