TigriWeb Components
AttributesControlsMetaPrimitivesIntegrations
  • Table of Contents
  • Attributes
    • Checkbox
    • Color
    • ColorGradient
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
    • ToolbarButton
    • ToolbarGroup
  • Controls
    • AppenderButton
    • Media
    • RichHeading
    • RichText
  • Meta
    • Checkbox
    • Color
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
  • Primitives
    • HTML
    • SVG
  • Integrations
    • Enqueue SVG icons
    • Enqueue I18n strings
Powered by GitBook
On this page

Was this helpful?

  1. Meta

TaxonomyMultiple

PreviousTaxonomyNextText

Last updated 6 months ago

Was this helpful?

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