BP_Groups_List_Table::add_group_type_bulk_change_select( string $which )
Markup for the Group Type bulk change select.
Description
Parameters
- $which
-
(Required) The location of the extra table nav markup: 'top' or 'bottom'.
Source
File: bp-groups/classes/class-bp-groups-list-table.php
public function add_group_type_bulk_change_select( $which ) {
// `$which` is only passed in WordPress 4.6+. Avoid duplicating controls in earlier versions.
static $displayed = false;
if ( version_compare( bp_get_major_wp_version(), '4.6', '<' ) && $displayed ) {
return;
}
$displayed = true;
$id_name = 'bottom' === $which ? 'bp_change_type2' : 'bp_change_type';
$types = bp_groups_get_group_types( array(), 'objects' );
?>
<div class="alignleft actions">
<label class="screen-reader-text" for="<?php echo $id_name; ?>"><?php _e( 'Change group type to…', 'buddyboss' ) ?></label>
<select name="<?php echo $id_name; ?>" id="<?php echo $id_name; ?>" style="display:inline-block;float:none;">
<option value=""><?php _e( 'Change group type to…', 'buddyboss' ) ?></option>
<?php foreach( $types as $type ) : ?>
<option value="<?php echo esc_attr( $type->name ); ?>"><?php echo esc_html( $type->labels['singular_name'] ); ?></option>
<?php endforeach; ?>
<option value="remove_group_type"><?php _e( 'No Group Type', 'buddyboss' ) ?></option>
</select>
<?php
wp_nonce_field( 'bp-bulk-groups-change-type-' . bp_loggedin_user_id(), 'bp-bulk-groups-change-type-nonce' );
submit_button( __( 'Change', 'buddyboss' ), 'button', 'bp_change_group_type', false );
?>
</div>
<?php
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.7.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.