PostTypeMultiple

TwebMetaPostTypeMultipleControl

{ label, help, postType*, metaKey* }
/**
 * @param {string} [label] - Component label.
 * @param {string} [help] - Component description.
 * @param {string} postType - The post type name.
 * @param {string} metaKey - Registered meta key from register_post_meta().
 */
functions.php
register_post_meta( 'post_type_name', 'test_posts', array(
	'type'         => 'array',
	'default'      => array(),
	'single'       => true,
	'show_in_rest' => array(
		'schema' => array(
			'type'  => 'array',
			'items' => array(
				'type' => 'number'
			)
		)
	),
) );
index.js
import {
	TwebMetaPostTypeMultipleControl,
} from '@tigriweb/components/meta';
index.js | PanelBody
<TwebMetaPostTypeMultipleControl
	label={ __('Posts Label', 'your-theme-name') }
	help={ __('Posts Description', 'your-theme-name') }
	postType="post"
	metaKey="test_posts"
/>

Last updated

Was this helpful?