Select
Last updated
Last updated
/**
* @param {string} [label] - Component label.
* @param {string} [help] - Component description.
* @param {object} choices - Object containing key-value pairs options.
* @param {string} metaKey - Registered meta key from register_post_meta().
*/
register_post_meta( 'post_type_name', 'test_select', array(
'type' => 'string',
'default' => 'choice3',
'single' => true,
'show_in_rest' => true,
) );
import {
TwebMetaSelectControl,
} from '@tigriweb/components/meta';
<TwebMetaSelectControl
label={ __('Select Label', 'your-theme-name') }
help={ __('Select Description', 'your-theme-name') }
choices={ {
'choice1': __('Choise 1', 'your-theme-name'),
'choice2': __('Choise 2', 'your-theme-name'),
'choice3': __('Choise 3', 'your-theme-name'),
} }
metaKey="test_select"
/>