# Adding Page Options

**Theme Options**

The framework will create a menu or submenu item in the WordPress menu. The script will auto-load itself on the correct admin hooks. You need to add a filter with next parameters:

```
add_filter('wpcfto_options_page_setup', function ($setups) {
    $setups[] = array(
        /*
         * Here we specify option name. It will be a key for storing in wp_options table
         */
        'option_name' => 'my_awesome_settings',
        
        'title' => esc_html__('Theme options', 'my-domain'),
        'sub_title' => esc_html__('by StylemixThemes', 'my-domain'),
        'logo' => 'https://s3.envato.com/files/235051023/avatar-80x80.png',

        /*
         * Next we add a page to display our awesome settings.
         * All parameters are required and same as WordPress add_menu_page.
         */
        'page' => array(
            'page_title' => 'Awesome Settings',
            'menu_title' => 'Settings',
            'menu_slug' => 'my_awesome_settings',
            'icon' => 'dashicons-editor-unlink',
            'position' => 40,
        ),

        /*
         * And Our fields to display on a page. We use tabs to separate settings on groups.
         */
        'fields' => array(
            // Even single tab should be specified
            'tab_1' => array(
                // And its name obviously
                'name' => esc_html__('Tab 1', 'my-domain'),
                'fields' => array(
                    // Field key and its settings. Full info about fields read in documentation.
                    'awesome_1' => array(
                        'type' => 'text',
                        'label' => esc_html__('Awesome Field label', 'my-domain'),
                        'value' => 'Awesome default value',
                    ),
                    'awesome_2' => array(
                        'type' => 'text',
                        'label' => esc_html__('Awesome Field label 2', 'my-domain'),
                        'value' => 'Awesome default value 2',
                    ),
                )
            ),

           /*
            * Other tabs you can add below
            */
            // ....
        )
    );

    return $setups;
});
```

And in your template, you can get your option as:

```
$my_awesome_options = get_option('my_awesome_settings', array());
/*
 * Where 'my_awesome_settings' is the same setup option name.
 */
```


---

# 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-page-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.
