Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/06/2016 07:55:32 AM (8 years ago)
Author:
r-a-y
Message:

Groups Admin: Better support for multiple group types.

If more than one group type is registered:

  • When editing a group, you can now set multiple group types for that group.
  • When viewing the Groups admin dashboard, all group types for a group are displayed in the "Group Type" column.

See #7210.

File:
1 edited

Legend:

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

    r11166 r11176  
    224224     *     @type string $label_element  Element to wrap around the label. Defaults to 'strong'.
    225225     *     @type array  $label_attr     Element attributes for label element. Defaults to array().
     226     *     @type bool   $show_all       Whether to show all registered group types. Defaults to 'false'. If
     227     *                                 'false', only shows group types with the 'show_in_list' parameter set to
     228     *                                  true. See bp_groups_register_group_type() for more info.
    226229     * }
    227230     * @return string
     
    239242            'label'          => __( 'Group Types:', 'buddypress' ),
    240243            'label_element'  => 'strong',
    241             'label_attr'     => array()
     244            'label_attr'     => array(),
     245            'show_all'       => false,
    242246        ), 'group_type_list' );
    243247
     
    246250        if ( $types = bp_groups_get_group_type( $group_id, false ) ) {
    247251            // Make sure we can show the type in the list.
    248             $types = array_intersect( bp_groups_get_group_types( array( 'show_in_list' => true ) ), $types );
    249             if ( empty( $types ) ) {
    250                 return $retval;
     252            if ( false === $show_all ) {
     253                $types = array_intersect( bp_groups_get_group_types( array( 'show_in_list' => true ) ), $types );
     254                if ( empty( $types ) ) {
     255                    return $retval;
     256                }
    251257            }
    252258
Note: See TracChangeset for help on using the changeset viewer.