# wp-bottom-menu/2.2.2/inc/multiple-select/multiple-select.php

WP Bottom Menu, version 2.2.2. 69 lines.

- Page: https://pluginprobe.com/plugins/wp-bottom-menu/2.2.2/code/inc/multiple-select/multiple-select.php
- Raw: https://pluginprobe.com/plugins/wp-bottom-menu/2.2.2/raw/inc/multiple-select/multiple-select.php
- Modified: 2024-01-17T20:12:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-bottom-menu/2.2.2/code/inc/multiple-select/multiple-select.php#L10-L20`.

```php
<?php

if ( ! class_exists( 'WP_Customize_Control' ) ) {
	return null;
}

/**
 * Multiselect option for WP Customizer
 *
 * @param $wp_customize
 */

/**
 * Multiple select customize control class.
 */
class Customize_Control_Multiple_Select extends WP_Customize_Control {

    /**
     * The type of customize control being rendered.
     */
    public $type = 'multiple-select';

    /**
     * Displays the multiple select on the customize screen.
     */
    public function render_content() {

        if ( empty( $this->choices ) ) {
            return;
        }
        ?>

        <label>
            <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
            <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
            <select <?php $this->link(); ?> class="wp-bottom-menu-select2" multiple="multiple" style="width: 100%">
                <?php
                foreach ( $this->choices as $value => $label ) {
                    $selected = ( in_array( $this->value(), $this->choices ) ) ? selected( 1, 1, false ) : '';
                    echo '<option value="' . esc_attr( $value ) . '"' . $selected . '>' . $label . '</option>';
                }
                ?>
            </select>
        </label>
    <?php

    }

}

function wpbm_get_user_roles() {

    global $wp_roles;
    $roles = [ 'all' => esc_html__( 'All Visitors', 'wp-bottom-menu' ) ];

    // check roles
    if ( ! isset( $wp_roles ) ){
        $wp_roles = new WP_Roles();
    }

    // add roles in array
    foreach( $wp_roles->get_names() as $key => $role ){
        $roles[$key] = $role;
    }

    // return roles
    return $roles;

}
```
