Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/21/2016 10:59:04 PM (3 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/create.php

    r11129 r11146  
    136136
    137137                </fieldset>
     138
     139                <?php // Group type selection ?>
     140                <?php if ( $group_types = bp_groups_get_group_types( array( 'show_in_create_screen' => true ), 'objects' ) ): ?>
     141
     142                    <fieldset class="group-create-types">
     143                        <legend><?php _e( 'Group Types', 'buddypress' ); ?></legend>
     144
     145                        <p><?php _e( 'Select the types this group should be a part of.', 'buddypress' ); ?></p>
     146
     147                        <?php foreach ( $group_types as $type ) : ?>
     148                            <div class="checkbox">
     149                                <label for="<?php printf( 'group-type-%s', $type->name ); ?>"><input type="checkbox" name="group-types[]" id="<?php printf( 'group-type-%s', $type->name ); ?>" value="<?php esc_attr_e( $type->name ); ?>" /> <?php esc_html_e( $type->labels['name'] ); ?>
     150                                    <?php
     151                                        if ( isset( $type->description ) ) {
     152                                            printf( __( '&ndash; %s', 'buddypress' ), '<span class="bp-group-type-desc">' . $type->description . '</span>' );
     153                                        }
     154                                    ?>
     155                                </label>
     156                            </div>
     157
     158                        <?php endforeach; ?>
     159
     160                    </fieldset>
     161
     162                <?php endif; ?>
    138163
    139164                <fieldset class="group-create-invitations">
Note: See TracChangeset for help on using the changeset viewer.