Color

TwebMetaColorControl

{ label, help, metaKey* }
/**
 * @param {string} [label] - Component label.
 * @param {string} [help] - Component description.
 * @param {string} metaKey - Registered meta key from register_post_meta().
 */
functions.php
register_post_meta( 'post_type_name', 'test_color', array(
	'type'         => 'string',
	'default'      => '',
	'single'       => true,
	'show_in_rest' => true,
) );
index.js
import {
	TwebMetaColorControl,
} from '@tigriweb/components/meta';
index.js | PanelBody
<TwebMetaColorControl
	label={ __('Color Label', 'your-theme-name') }
	metaKey="test_color"
/>

Last updated

Was this helpful?