> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wpbevel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hooks and constants

> Every filter and action the theme, Bevel Kit and Bevel MCP expose, with defaults, and the constants a site can set.

Hook names starting `bevel/` belong to Bevel Kit; `bevel_mcp_` to Bevel MCP; the theme's are plain `bevel_`. Each row gives the arguments and the default.

## Theme

| Hook                                 | Args (default)        | Purpose                                                                                                   |
| ------------------------------------ | --------------------- | --------------------------------------------------------------------------------------------------------- |
| `bevel_header_footer`                | `bool` (true)         | Draw the theme's own header and footer when no builder template applies.                                  |
| `bevel_page_title`                   | `bool` (true)         | Print a fallback part's title block. The theme sets it false for documents with Elementor's "Hide Title". |
| `bevel_content_width`                | `int` (800)           | `$content_width`.                                                                                         |
| `bevel_enable_skip_link`             | `bool` (true)         | Print the skip link.                                                                                      |
| `bevel_skip_link_url`                | `string` (`#content`) | Its target.                                                                                               |
| `bevel_viewport_content`             | `string`              | The viewport meta content.                                                                                |
| `bevel_description_meta_tag`         | `bool` (true)         | Excerpt as meta description on singular.                                                                  |
| `bevel_register_elementor_locations` | `bool` (true)         | Register Elementor's core locations.                                                                      |
| `bevel_add_woocommerce_support`      | `bool` (true)         | Declare WooCommerce supports.                                                                             |

## Bevel Kit

### Theme Builder and locations

| Hook                                                                            | Args (default)                       | Purpose                                                                                                                                                                               |
| ------------------------------------------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bevel/theme_builder/document_types`                                            | `array` type → class                 | The template types (header, footer, single, single-post, single-page, archive, search-results, error-404, section; popups, loop items and the shop types are added by their modules). |
| `bevel/theme_builder/groups`                                                    | `array`                              | Sidebar groups of the Theme Builder app.                                                                                                                                              |
| `bevel/theme_builder/post_types`                                                | `array` slug → label                 | Post types offered as condition targets.                                                                                                                                              |
| `bevel/theme_builder/documents_for_location`                                    | `array $documents, string $location` | Templates chosen for a location, best match first.                                                                                                                                    |
| `bevel/theme_builder/conditions/register` (action)                              | `Conditions_Manager`                 | Register additional display conditions.                                                                                                                                               |
| `bevel/theme_builder/conditions_cache/extra_ids`                                | `int[]`                              | Documents with conditions outside the template library.                                                                                                                               |
| `bevel/theme_builder/template_item`                                             | `array $item, $document`             | A template's row in the list.                                                                                                                                                         |
| `bevel/theme_builder/preview_query_args`                                        | `array $args, $document`             | The query a template previews with.                                                                                                                                                   |
| `bevel/theme/register_locations` (action)                                       | `Locations_Manager`                  | Themes register locations.                                                                                                                                                            |
| `bevel/theme/locations_registered` (action)                                     | `Locations_Manager`                  | After registration.                                                                                                                                                                   |
| `bevel/theme/before_do_{location}`, `bevel/theme/after_do_{location}` (actions) | `Locations_Manager`                  | Around a location's output.                                                                                                                                                           |
| `bevel/theme/need_override_location`                                            | `bool, string $location, $manager`   | Whether to take over the page for a location.                                                                                                                                         |

### Forms

| Hook                                  | Args (default)                   | Purpose                                               |
| ------------------------------------- | -------------------------------- | ----------------------------------------------------- |
| `bevel/forms/field_types`             | `array`                          | Field types the Form widget offers.                   |
| `bevel/forms/actions`                 | `Action_Base[]`                  | Actions after submit.                                 |
| `bevel/forms/before_actions` (action) | `Record, Response`               | After validation, before actions.                     |
| `bevel/forms/trusted_proxies`         | `string[]` (Cloudflare's ranges) | Proxies whose forwarded-address headers are believed. |
| `bevel/forms/rate_limit`              | `int` (10)                       | Submissions per address per minute; 0 disables.       |

### Site Settings and admin

| Hook                                    | Args (default) | Purpose                                           |
| --------------------------------------- | -------------- | ------------------------------------------------- |
| `bevel/site_settings/panel_tabs`        | `array`        | Panel tabs after the Kit's Settings tab.          |
| `bevel/site_settings/settings_sections` | `array`        | Sub-tabs of the Settings tab.                     |
| `bevel/site_settings/option_fields`     | `array`        | Option-backed fields the Save button may write.   |
| `bevel/site_settings/settings_groups`   | `array`        | Which options each sub-tab shows.                 |
| `bevel/admin/pages`                     | `array`        | The Kit's admin screens for the rail and top bar. |

### Editor, elements, templates

| Hook                                     | Args (default)    | Purpose                                                 |
| ---------------------------------------- | ----------------- | ------------------------------------------------------- |
| `bevel/elementor/pin_to_v3`              | `bool` (true)     | Keep Elementor's V4 experiments off.                    |
| `bevel/elements/attributes/blocked`      | `string[]`        | Attributes the custom-attributes control may never set. |
| `bevel/kit/allow_unfiltered_custom_code` | `bool, $document` | Who may save raw custom code.                           |
| `bevel/dynamic_tags/classes`             | `string[]`        | The dynamic tag classes registered.                     |
| `bevel/templates/api_url`                | `string`          | The template library endpoint.                          |
| `bevel/editor_templates/tabs`            | `array`           | Tabs of the template modal.                             |
| `bevel/svg/user_can_upload`              | `bool, $user`     | Who may upload SVG.                                     |
| `bevel/starter/auto_run`                 | `bool` (true)     | Install starter templates on a bare site.               |

### Loops, menus, duplicator

| Hook                                        | Args (default)                    | Purpose                              |
| ------------------------------------------- | --------------------------------- | ------------------------------------ |
| `bevel/loop/query_args`                     | `array $args, array $settings`    | A loop widget's query arguments.     |
| `bevel/loop/query/{query_id}` (action)      | `WP_Query, $widget`               | Adjust a named loop's query.         |
| `bevel_custom_menu_item_output`             | `string, WP_Post, int, $args`     | Rendered menu item markup.           |
| `bevel_tb_megamenu_url_{item_id}`           | `string`                          | One mega-menu item's link.           |
| `bevel/post_duplicator/duplicated` (action) | `int $original, int $copy, array` | After a duplicate is made.           |
| `bevel/post_duplicator/meta_value`          | `mixed, string $key, int $copy`   | A meta value on its way to the copy. |
| `bevel/post_duplicator/excluded_meta_keys`  | `string[]`                        | Meta the copy never inherits.        |
| `bevel/post_duplicator/copy_meta/{key}`     | `bool, string`                    | Copy one meta key or not.            |
| `bevel/post_duplicator/excluded_taxonomies` | `string[]`                        | Taxonomies the copy never inherits.  |

### Optimizer

| Hook                                     | Args (default)                   | Purpose                                                     |
| ---------------------------------------- | -------------------------------- | ----------------------------------------------------------- |
| `bevel_optimizer_enabled`                | `bool` (true)                    | Whether the JS delay engine runs on this request.           |
| `bevel_optimizer_exclude`                | `bool, string`                   | Exclude a script (by inline text, id or src) from delaying. |
| `bevel_optimizer_frontend_config`        | `array $config, array $settings` | The engine's configuration object.                          |
| `bevel_optimizer_frontend_rewrite`       | `string $html, array $settings`  | The page HTML before script tags are neutralised.           |
| `bevel_optimizer_load_settings`          | `array`                          | Settings after they are read.                               |
| `bevel_optimizer_comment`                | `string`                         | The HTML comment above the engine.                          |
| `bevel_max_first_section_image_preloads` | `int` (4)                        | Preload links per page.                                     |
| `bevel_preload_min_image_pixels`         | `int` (50000)                    | Minimum rendered area for an LCP candidate.                 |
| `bevel_first_section_preload_items`      | `array, int $post_id, array`     | The preload candidates of the first section.                |

## Bevel MCP

| Hook                        | Args (default)                                                                                                   | Purpose                                                                                                                                         |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `bevel_mcp_features`        | `array` (`docs_minimal`, `no_verify_hint`, `rich_tools`, `slim_guides`, `async_images` true; `plan_build` false) | How the site builds: compact guides and descriptions, one-time notes, compound arguments, deferred image import, the plan-based page generator. |
| `bevel_mcp_allowed_origins` | `string[]` (the site's host)                                                                                     | Browser origins allowed to call the endpoint.                                                                                                   |

## Constants

Read from `wp-config.php`:

| Constant                                                              | Default                                | Purpose                                                                                                |
| --------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `WP_CACHE`                                                            | written by the page cache when enabled | The page cache adds `define('WP_CACHE', true)` on its own marked line and only ever removes that line. |
| `DONOTCACHEPAGE`                                                      |                                        | Respected by the page cache, even when set late in a template.                                         |
| `BEVEL_KIT_ACCOUNT_SERVER`                                            | `https://my.wpbevel.com`               | The optional account server.                                                                           |
| `BEVEL_KIT_ACCOUNT_API`, `BEVEL_KIT_CONNECT_URL`, `BEVEL_KIT_PRODUCT` | derived                                | Its API base, connect URL and product id.                                                              |

Defined by the code: `BEVEL_VERSION`, `BEVEL_KIT_VERSION`, `BEVEL_KIT_MIN_ELEMENTOR` (3.25.0), `BEVEL_KIT_MIN_PHP` (8.0), `BEVEL_MCP_VERSION`, and the path and URL constants of each.
