# Adding Post Options

WordPress powered with Post Type meta boxes. Add Meta Box to the desired post type with a unique ID.

```
add_filter('stm_wpcfto_boxes', function ($boxes) {

    $boxes['my_metabox'] = array(
        'post_type' => array('post', 'my-custom-post-type'),
        'label' => esc_html__('Post settings', 'my-domain'),
    );

    return $boxes;
});
```

And we need to add fields to this Meta Box:

```
add_filter('stm_wpcfto_fields', function ($fields) {

    $fields['my_metabox'] = array(

        'tab_1' => array(
            'name' => esc_html__('Field Settings', 'my-domain'),
            'fields' => array(
                'field_1' => array(
                    'type' => 'text',
                    'label' => esc_html__('Field text', 'my-domain'),
                ),
            )
        ),

    );

    return $fields;
});
```

#### Custom Fields

You can easily use default WordPress functions such as `get_post_meta()`, `get_option()` or `get_term_meta()`. But for the option we built-in function to get any param you want:

```
$options = stm_wpcfto_get_options('my_awesome_settings');
```


---

# 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.stylemixthemes.com/nuxy/adding-post-options.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.
