/CMB2-Switch-Button-Metafield

Switch-button metafield for CMB2

Primary LanguagePHP

CMB2 Switch Button Field Type

Switch field type for CMB2. Ready to use with a theme

Use

switch as a field type.

array(
	    'name'        => __('Switch Field', 'cmb2'),
	    'id'	  => $prefix . 'switch_field_id',
	    'desc'        => __('Switch Field Description.','cmb2'),	    
		  'type'    => 'switch',
		  'default'    => 0,
		  'label'    => array('on'=> 'Yes', 'off'=> 'No') //default On, Off
  )
  

Screenshots

Image

Tutorial on how to integrate Switch Button field in to a WordPress theme

http://www.proy.info/how-to-create-cmb2-switch-field/