mustardBees / cmb-field-select2

Select2 field type for Custom Metaboxes and Fields for WordPress
93 stars 46 forks source link

No minimum text length #54

Open Shahriarabedi opened 1 year ago

Shahriarabedi commented 1 year ago

Hello, I want to use this plugin without a minimum, that is, there is no need to write at least 3 letters. what should I do?

mustardBees commented 1 year ago

@Shahriarabedi AFAIK this plugin doesn't specify a default minimum value.

Can you confirm the version you're running and post your meta box configuration?

When defining the field, you can configuration Select2 via its system of data-* attributes. For example, to set the minimum search term length to 0:

$example_meta_box->add_field( array(
    'name'          => 'Example',
    'id'            => $prefix . 'example',
    'type'          => 'pw_select',
    'options_cb'    => 'iweb_get_cmb2_post_options',
    'attributes'    => array(
        'data-minimum-input-length' => 0,
    ),
) );