# Meta boxes

This configuration contains parameters that HivePress uses for registering the custom [meta boxes](https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/). Each meta box is defined as an array of the following parameters:

* **title** - the meta box title;
* **screen** - an array of post types or taxonomy names (without the `hp_` prefix) to display the meta box for;
* **fields** - an array of meta box fields, each field must be defined as an array of the [field](/developer-docs/framework/fields.md) parameters.

The code example below adds a new meta box with a single checkbox field to the back-end listing edit page. By default, the field value is saved to the post (or term) meta. To save the field value to one of the standard post (or term) fields, use the `_alias` parameter.

```php
add_filter(
	'hivepress/v1/meta_boxes',
	function( $meta_boxes ) {
		$meta_boxes['custom_meta_box'] = [
			'title'  => 'Custom Meta Box',
			'screen' => 'listing',

			'fields' => [
				'custom_option' => [
					'label'  => 'Custom Option',
					'type'   => 'checkbox',
					'_order' => 123,
				],
			],
		];

		return $meta_boxes;
	}
);
```

In the same way, you can customize any of the available meta boxes or register a new one by adding an array with the meta box parameters. For example, the code below adds a new text field to the **Listing Settings** meta box.

```php
add_filter(
	'hivepress/v1/meta_boxes/listing_settings',
	function( $meta_box ) {
		$meta_box['fields']['custom_field'] = [
			'label'  => 'Custom Field',
			'type'   => 'text',
			'_order' => 123,
		];

		return $meta_box;
	}
);
```


---

# 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.hivepress.io/developer-docs/framework/configurations/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.
