Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
numeroteca opened this issue Mar 9, 2020 · 0 comments
Open

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

numeroteca opened this issue Mar 9, 2020 · 0 comments
Assignees
Labels

Comments

@numeroteca
Copy link
Member

numeroteca commented Mar 9, 2020

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
),
@numeroteca numeroteca changed the title How to deal with 2checkbox" CMB field? How to deal with checkbox" or predefined answers CMB fields? Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants