Skip to content

How to deal with checkbox" or predefined answers CMB fields? #70

@numeroteca

Description

@numeroteca

Cehckbox
While converting to taxonomies all the CMB fields I found this one "Formally registered", that is a checkbox (convertible to yes/no field) but we should check how data is stored to see how it works.

$prefixwpg es _wpg_

array(
 'name' => 'Formally registered',
 'desc' => 'Select if the organization is officially registered and has legal status.',
 'id' => '_wpg_formally_registered',
 'type' => 'checkbox',
),

Predefined answers
Related question with this other type of answer with predefined CMB answers:

array(
	'name' => 'Internal Elections: how often?',
	'desc' => '',
	'id' => $prefixwpg . 'elections',
	'type' => 'radio_inline',
	'options' => array(
	    array('name' => 'no', 'value' => 'no'),
	    array('name' => 'Quarterly', 'value' => 'quarterly'),
	    array('name' => 'annually', 'value' => 'annually'),
	    array('name' => 'every 2 years', 'value' => 'every 2 years'),
	    array('name' => 'every 3 years', 'value' => 'every 3 years'),
	    array('name' => 'every 4 years', 'value' => 'every 4 years'),
	    array('name' => 'every 5 years', 'value' => 'every 5 years'),
	    array('name' => 'other', 'value' => 'other'),
	)
),

or

array(
	'name' => 'Do you sell to middlemen?',
	'desc' => '',
	'id' => $prefixwpg . 'middlemen',
	'type' => 'radio_inline',
	'options' => array(
		  array('name' => 'Yes', 'value' => 'yes'),
		  array('name' => 'No', 'value' => 'no'),
	)
),

Datetime
¿Cómo convertir estos campos?
Quizás el cuando fue actualizado podemos usar el de wordpress por defecto.
Para los otros evaluar si necesitamos campo múltiple.

array(
		'name' => 'Date of Data Entry',
		'desc' => '',
		'id' => $prefixwpg . 'date_data_entry',
		'type' => 'text_date_timestamp'
),
array(
		'name' => 'Date Data Updated',
		'desc' => '',
		'id' => $prefixwpg . 'date_data_updated',
		'type' => 'text_date_timestamp' //TODO, if this is a multiple data entry, we can not use this type of metabox
),

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions