BP_Groups_List_Table::add_group_type_bulk_change_select( string $which )

Markup for the Group Type bulk change select.


Parameters Parameters

$which

(string) (Required) The location of the extra table nav markup: 'top' or 'bottom'.


Source 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&hellip;', 'buddypress' ) ?></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&hellip;', 'buddypress' ) ?></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', 'buddypress' ) ?></option>

			</select>
			<?php
			wp_nonce_field( 'bp-bulk-groups-change-type-' . bp_loggedin_user_id(), 'bp-bulk-groups-change-type-nonce' );
			submit_button( __( 'Change', 'buddypress' ), 'button', 'bp_change_group_type', false );
		?>
		</div>
		<?php
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.