# Meta Boxes

Alchemy Options fields can be used in [Meta Boxes](https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/). Please take a look at the following configuration example.

```php
function add_custom_meta_boxes() {
    if( ! class_exists( 'Alchemy_Options\Includes\Meta_Boxes' ) || wp_doing_ajax() ) {
        return;
    }

    $meta_boxes = array(
        array(
            'id' => 'meta_box',
            'title' => 'Meta box title',
            'post-types' => array( 'page' ),
            'meta' => array(
                'options' => array(),
            ),
        ),
    );

    new Alchemy_Options\Includes\Meta_Boxes( $meta_boxes );
}

add_action( 'init', 'add_custom_meta_boxes' );
```

## Params

| Name         | Type   | Description                                                                                                  |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------ |
| `id`         | string | Unique ID **(required)**                                                                                     |
| `title`      | string | Shows a heading on the meta box **(required)**                                                               |
| `post-types` | array  | A list of post types where this meta box should appear **(required)**                                        |
| `meta`       | array  | A list of meta options. Should have the `options` array containing regular options signatures **(required)** |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alchemy-options.com/v0.9/meta-boxes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
