> For the complete documentation index, see [llms.txt](https://tigriweb.gitbook.io/components/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tigriweb.gitbook.io/components/meta/media.md).

# Media

[TwebMetaMediaControl](https://github.com/tigriweb/components/blob/master/meta/TwebMetaMediaControl.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%2FnUNXlIYIUjwbanmyUJ3Y%2Fmedia.jpg?alt=media&amp;token=16f3bb0e-d283-4fc2-ae70-f1096e5a9487" alt=""><figcaption></figcaption></figure></div>

<details>

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

```jsx
/**
 * @param {string} [label] - Component label.
 * @param {string} [help] - Component description.
 * @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_media', array(
	'type'         => 'number',
	'default'      => 0,
	'single'       => true,
	'show_in_rest' => true,
) );
```

{% endcode %}

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

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

{% endcode %}

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

```jsx
<TwebMetaMediaControl
	label={ __('Media Label', 'your-theme-name') }
	help={ __('Media Description', 'your-theme-name') }
	metaKey="test_media"
/>
```

{% endcode %}
