> ## Documentation Index
> Fetch the complete documentation index at: https://vr-it-services-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Hooks and filters

> Every action, filter, helper function, and sanitizer the theme exposes.

The theme exposes hooks across its main extension points. Prefer them over template overrides wherever one fits — they survive theme updates and are far less likely to break your markup.

## Actions

Actions let you run code at a specific point. They are called with `do_action()`and you attach to them with `add_action()`.

### Core WordPress actions used

| Action | Priority | What the theme does |
| - | - | - |
| `after_setup_theme` | 0 | Writes brand colors and typography into the Elementor Kit |
| `after_setup_theme` | default | Theme supports, text domain, menus, image sizes |
| `init` | default | Block patterns and block styles |
| `widgets_init` | default | Registers the sidebar and footer widget areas |
| `wp_enqueue_scripts` | default | Styles, scripts, fonts, Font Awesome |
| `wp_head` | 7 | Open Graph tags, theme color, JSON-LD |
| `wp_footer` | 20 | Scroll-to-top button markup |
| `body_class` | default | Layout, sidebar, and builder detection classes |
| `nav_menu_item_title` | default | Injects menu item icons |
| `the_password_form` | default | Replaces the default password form |
| `customize_register` | default | Registers the whole Customizer panel |
| `customize_controls_enqueue_scripts` | default | Customizer control panel assets |
| `save_post_page` | default | Saves the per-page sidebar setting |
| `admin_init` | 6 | Regenerates a homepage layout if one is missing |
| `after_switch_theme` | default | Clears a few theme options on activation |
| `before_delete_post` | default | Cleans up when a managed page is deleted |
| `wp_trash_post` | default | Cleans up when a managed page is trashed |

### Example

```php theme={null}
add_action( 'wp_footer', function () {
    if ( is_singular() ) {
        echo '<!-- Rendered by my child theme -->';
    }
}, 21 );
```

### Elementor and admin filters

| Filter | Type | Purpose |
| - | - | - |
| `vara_saas_is_elementor_active_request` | bool | Whether the current request is an Elementor request |
| `vara_saas_is_elementor_page` | bool | Whether a given page is builder-owned |
| `vara_saas_customize_register` | object | The `WP_Customize_Manager` instance |
| `vara_saas_customize_controls_enqueue` | — | Hook point inside the control-panel enqueue |
| `vara_saas_handle_managed_page_deletion` | — | Hook point in the page deletion handler |
| `vara_saas_default_pages_initialized` | — | Fires after managed pages are set up |
| `vara_saas_demo_pages_created` | — | Fires after the demo import completes |

### Core filters used

| Filter | Purpose |
| - | - |
| `style_loader_tag` | Swaps the main stylesheet to a non-blocking load |
| `script_loader_tag` | Adds `defer` to the main script |
| `wp_resource_hints` | Font resource hints — a no-op, since fonts are self-hosted |

## Helper functions

Global functions the theme defines. All are prefixed `vara_saas_`.

### Content helpers

| Function | Returns |
| - | - |
| `vara_saas_estimated_reading_time()` | Estimated reading time for the current post |
| `vara_saas_extract_toc( $content )` | Array with `toc` and `content`, headings given unique IDs |
| `vara_saas_get_related_posts()` | Posts sharing a category with the current post |
| `vara_saas_breadcrumbs()` | Outputs a Yoast-aware breadcrumb trail |
| `vara_saas_the_password_form()` | Outputs the styled password form |
| `vara_saas_get_category_chip_class()` | Modifier class for a category slug |
| `vara_saas_get_tag_list_with_overflow()` | Tag pills with an overflow control |
| `vara_saas_get_category_overflow_html()` | Category pills with an overflow control |

> [!WARNING]
>
> **Functions marked as global may change signature between releases.** Wrap calls in a `function_exists()` check if your code must survive a major theme update.

### Detection helpers

| Function | Returns |
| - | - |
| `vara_saas_is_elementor_active_request()` | Whether this is an Elementor editor or preview request |
| `vara_saas_is_elementor_page( $post_id )` | Whether a page is builder-owned |

### Elementor integration

| Function | Purpose |
| - | - |
| `vara_saas_apply_elementor_template_to_page()` | Writes a bundled template to a page |
| `vara_saas_ensure_elementor_homepage_layout()` | Regenerates the homepage layout if missing |
| `vara_saas_el_widget()`, `vara_saas_el_column()`, `vara_saas_el_section()` | Layout builder primitives |
| `vara_saas_el_heading()`, `vara_saas_el_text()`, `vara_saas_el_button()` | Widget builders |
| `vara_saas_el_spacer()`, `vara_saas_el_divider()` | Spacer and divider builders |
| `vara_saas_build_homepage()` | Generates a complete homepage layout |

### Page management

| Function | Purpose |
| - | - |
| `vara_saas_required_plugins()` | The plugin list the wizard manages |
| `vara_saas_get_theme_default_pages()` | The five managed page definitions |
| `vara_saas_get_theme_page_id( $key )` | The stored ID for a managed page |
| `vara_saas_get_or_create_theme_page( $key )` | Finds or creates a managed page |
| `vara_saas_get_theme_page_url( $key, $fallback )` | The URL for a managed page |
| `vara_saas_assign_default_site_pages()` | Applies front page and posts page settings |

> [!WARNING]
>
> **Do not expose the theme's AJAX actions without a nonce and a capability check.** They all have both. Copy the pattern, not just the handler.

## Sanitizers

The theme validates every Customizer input on save. Reuse these if you build your own controls.

| Sanitizer | Validates |
| - | - |
| `vara_saas_sanitize_bool()` | Booleans |
| `vara_saas_sanitize_layout()` | Layout values against an allowlist |
| `vara_saas_sanitize_font_family()` | Font family against a six-item allowlist |
| `vara_saas_sanitize_icon()` | Strict Font Awesome class pattern |
| `vara_saas_sanitize_align()` | Alignment against an allowlist |
| `vara_saas_sanitize_html()` | HTML through `wp_kses_post()` |
| `vara_saas_sanitize_footer_columns()` | Integer clamped to 2–4 |
| `vara_saas_sanitize_single_post_layout()` | Single post layout against an allowlist |

## Related

> **[Child themes](/developers/child-themes.md)**
>
> Where to put your code.

> **[CSS and design tokens](/developers/css-and-design-tokens.md)**
>
> Styling with the theme's variables.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.