# PostTypeMultiple

[TwebMetaPostTypeMultipleControl](https://github.com/tigriweb/components/blob/master/meta/TwebMetaPostTypeMultipleControl.js)

<div align="left" data-full-width="false"><figure><img src="https://870798947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWAokPCWM65E5XQJVixgi%2Fuploads%2FbyoEGbgEo3MkMdhBtgjK%2Fpost-type-multiple.jpg?alt=media&#x26;token=1dd489d7-7edc-469f-bc6f-eda8dcb12709" alt=""><figcaption></figcaption></figure></div>

<details>

<summary>{ label, help, postType*, metaKey* }</summary>

```jsx
/**
 * @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().
 */
```

</details>

{% code title="functions.php" overflow="wrap" %}

```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'
			)
		)
	),
) );
```

{% endcode %}

{% code title="index.js" overflow="wrap" %}

```jsx
import {
	TwebMetaPostTypeMultipleControl,
} from '@tigriweb/components/meta';
```

{% endcode %}

{% code title="index.js | PanelBody" %}

```jsx
<TwebMetaPostTypeMultipleControl
	label={ __('Posts Label', 'your-theme-name') }
	help={ __('Posts Description', 'your-theme-name') }
	postType="post"
	metaKey="test_posts"
/>
```

{% endcode %}
