2017 © Pedro Peláez
 

library cmb-field-select2

image

podkot/cmb-field-select2

  • Tuesday, March 6, 2018
  • by podkot
  • Repository
  • 0 Watchers
  • 0 Stars
  • 20 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 67 % Grown

The README.md

CMB Field Type: Select2

Description

Select2 field type for CMB2., (*1)

Running an older version of CMB? Check the previous releases., (*2)

This plugin gives you two CMB field types based on the Select2 script:, (*3)

  1. The pw_select field acts much like the default select field. However, it adds typeahead-style search allowing you to quickly make a selection from a large list
  2. The pw_multiselect field allows you to select multiple values with typeahead-style search. The values can be dragged and dropped to reorder

Installation

You can install this field type as you would a WordPress plugin:, (*4)

  1. Download the plugin
  2. Place the plugin folder in your /wp-content/plugins/ directory
  3. Activate the plugin in the Plugin dashboard

Alternatively, you can place the plugin folder in with your theme/plugin. After you call CMB:, (*5)

require_once 'init.php';

Add another line to include the cmb-field-select2.php file. Something like:, (*6)

require_once 'cmb-field-select2/cmb-field-select2.php';

Usage

pw_select - Select box with with typeahead-style search. Example:, (*7)

array(
    'name'    => 'Cooking time',
    'id'      => $prefix . 'cooking_time',
    'desc'    => 'Cooking time',
    'type'    => 'pw_select',
    'options' => array(
        '5'  => '5 minutes',
        '10' => '10 minutes',
        '30' => 'Half an hour',
        '60' => '1 hour',
    ),
),

pw_multiselect - Multi-value select box with drag and drop reordering. Example:, (*8)

array(
    'name'    => 'Ingredients',
    'id'      => $prefix . 'ingredients',
    'desc'    => 'Select ingredients. Drag to reorder.',
    'type'    => 'pw_multiselect',
    'options' => array(
        'flour'  => 'Flour',
        'salt'   => 'Salt',
        'eggs'   => 'Eggs',
        'milk'   => 'Milk',
        'butter' => 'Butter',
    ),
),

Screenshots

Select box

Image, (*9)

Multi-value select box

Image, (*10)

Image, (*11)

Image, (*12)

The Versions

23/10 2016

dev-master

9999999-dev https://bitbucket.org/podkot/cmb-field-select2

Select2 field type for CMB2

  Sources   Download

GPL-2.0+

plugin wordpress

23/10 2016

2.1.1

2.1.1.0 https://bitbucket.org/podkot/cmb-field-select2

Select2 field type for CMB2

  Sources   Download

GPL-2.0+

plugin wordpress