Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/21/2016 10:59:04 PM (7 years ago)
Author:
r-a-y
Message:

Groups: Add group type settings fields and a group type list on single group pages.

  • If group types are registered with the 'show_in_create_screen' parameter, group administrators can set the group type when creating a group or when on a group's "Manage > Settings" page.
  • If group types are registered with the 'show_in_list' parameter, a comma-delimited list of group types can be displayed for a group with the bp_group_type_list() function. By default, this function is used on a group page's header.

See #7210.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress/groups/single/admin/group-settings.php

    r11051 r11146  
    6868</fieldset>
    6969
     70<?php // Group type selection ?>
     71<?php if ( $group_types = bp_groups_get_group_types( array( 'show_in_create_screen' => true ), 'objects' ) ): ?>
     72
     73    <fieldset class="group-create-types">
     74        <legend><?php _e( 'Group Types', 'buddypress' ); ?></legend>
     75
     76        <p><?php _e( 'Select the types this group should be a part of.', 'buddypress' ); ?></p>
     77
     78        <?php foreach ( $group_types as $type ) : ?>
     79            <div class="checkbox">
     80                <label for="<?php printf( 'group-type-%s', $type->name ); ?>">
     81                    <input type="checkbox" name="group-types[]" id="<?php printf( 'group-type-%s', $type->name ); ?>" value="<?php esc_attr_e( $type->name ); ?>" <?php checked( bp_groups_has_group_type( bp_get_current_group_id(), $type->name ) ); ?>/> <?php esc_html_e( $type->labels['name'] ); ?>
     82                    <?php
     83                        if ( ! empty( $type->description ) ) {
     84                            printf( __( '&ndash; %s', 'buddypress' ), '<span class="bp-group-type-desc">' . esc_html( $type->description ) . '</span>' );
     85                        }
     86                    ?>
     87                </label>
     88            </div>
     89
     90        <?php endforeach; ?>
     91
     92    </fieldset>
     93
     94<?php endif; ?>
     95
    7096<fieldset class="group-create-invitations">
    7197
Note: See TracChangeset for help on using the changeset viewer.