Checkbox
Last updated
Was this helpful?
Last updated
Was this helpful?
/**
* @param {string} [label] - Component label.
* @param {string} [help] - Component description.
* @param {string} metaKey - Registered meta key from register_post_meta().
*/
register_post_meta( 'post_type_name', 'test_checkbox', array(
'type' => 'boolean',
'default' => false,
'single' => true,
'show_in_rest' => true,
) );
import {
TwebMetaCheckboxControl,
} from '@tigriweb/components/meta';
<TwebMetaCheckboxControl
label={ __('Checkbox Label', 'your-theme-name') }
help={ __('Checkbox Description', 'your-theme-name') }
metaKey="test_checkbox"
/>