Skip to:
Content

BuddyPress.org

Changeset 11182


Ignore:
Timestamp:
10/06/2016 09:02:40 PM (3 years ago)
Author:
r-a-y
Message:

Groups: Add 'create_screen_checked' argument to bp_groups_register_group_type().

If $show_in_create_screen is true, whether we should have our group type
checkbox checked by default during the group creation process. Handy if you
want to imply that the group type should be enforced, but decision
ultimately lies with the group creator.

Props hnla, dcavins.

See #7210.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-functions.php

    r11145 r11182  
    21172117 * @since 2.6.0
    21182118 * @since 2.7.0 Introduce $has_directory, $show_in_create_screen, $show_in_list, and
    2119  *              $description as $args parameters.
     2119 *              $description, $create_screen_checked as $args parameters.
    21202120 *
    21212121 * @param string $group_type Unique string identifier for the group type.
     
    21322132 *     @type string      $description           A short descriptive summary of what the group type is. Currently shown
    21332133 *                                              on a group's "Manage > Settings" page when selecting group types.
     2134 *     @type bool        $create_screen_checked If $show_in_create_screen is true, whether we should have our group type
     2135 *                                              checkbox checked by default. Handy if you want to imply that the group
     2136 *                                              type should be enforced, but decision lies with the group creator.
     2137 *                                              Default: false.
    21342138 *     @type array       $labels {
    21352139 *         Array of labels to use in various parts of the interface.
     
    21532157        'show_in_list'          => null,
    21542158        'description'           => '',
     2159        'create_screen_checked' => false,
    21552160        'labels'                => array(),
    21562161    ), 'register_group_type' );
  • trunk/src/bp-templates/bp-legacy/buddypress/groups/create.php

    r11177 r11182  
    156156                        <?php foreach ( $group_types as $type ) : ?>
    157157                            <div class="checkbox">
    158                                 <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 echo esc_attr( $type->name ); ?>" /> <?php echo esc_html( $type->labels['name'] ); ?>
     158                                <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 echo esc_attr( $type->name ); ?>" <?php checked( true, ! empty( $type->create_screen_checked ) ); ?> /> <?php echo esc_html( $type->labels['name'] ); ?>
    159159                                    <?php
    160160                                        if ( ! empty( $type->description ) ) {
Note: See TracChangeset for help on using the changeset viewer.