Repository navigation
Hooks and Filters
Alex de Borba edited this page Jun 21, 2026
·
1 revision
This page documents all WordPress action hooks and filters provided by the Aegis theme. These hooks allow developers and plugins to extend theme functionality without modifying core files.
These hooks fire at specific locations within templates:
| Hook | Location | Parameters |
|---|---|---|
aegis_before_header |
Before the header template part | None |
aegis_after_header |
After the header template part | None |
aegis_before_footer |
Before the footer template part | None |
aegis_after_footer |
After the footer template part | None |
aegis_before_content |
Before the main content area | None |
aegis_after_content |
After the main content area | None |
| Hook | Location | Parameters |
|---|---|---|
aegis_before_post_title |
Before the post title | $post_id |
aegis_after_post_title |
After the post title | $post_id |
aegis_before_post_content |
Before the post body | $post_id |
aegis_after_post_content |
After the post body | $post_id |
aegis_before_comments |
Before the comments section | $post_id |
aegis_after_comments |
After the comments section | $post_id |
| Hook | Location | Parameters |
|---|---|---|
aegis_before_archive_title |
Before the archive header | None |
aegis_after_archive_title |
After the archive header | None |
aegis_before_loop |
Before the post loop | None |
aegis_after_loop |
After the post loop | None |
aegis_between_posts |
Between loop iterations |
$post_id, $index
|
| Hook | Timing | Parameters |
|---|---|---|
aegis_before_enqueue_styles |
Before theme styles are enqueued | None |
aegis_after_enqueue_styles |
After theme styles are enqueued | None |
aegis_before_enqueue_scripts |
Before theme scripts are enqueued | None |
aegis_after_enqueue_scripts |
After theme scripts are enqueued | None |
| Hook | Timing | Parameters |
|---|---|---|
aegis_before_register_blocks |
Before custom blocks are registered | None |
aegis_after_register_blocks |
After all custom blocks are registered | None |
aegis_before_register_patterns |
Before patterns are registered | None |
aegis_after_register_patterns |
After all patterns are registered | None |
Available only when WooCommerce is active:
| Hook | Location | Parameters |
|---|---|---|
aegis_before_product_loop |
Before the product grid | None |
aegis_after_product_loop |
After the product grid | None |
aegis_before_cart_totals |
Before cart totals | None |
aegis_before_checkout_form |
Before checkout fields | None |
aegis_checkout_step_change |
When multi-step checkout advances | $step_number |
| Filter | Description | Parameters | Return |
|---|---|---|---|
aegis_enqueue_block_styles |
Filter the list of block styles to enqueue |
$styles (array) |
Array of style handles |
aegis_enqueue_block_scripts |
Filter the list of block scripts to enqueue |
$scripts (array) |
Array of script handles |
aegis_detected_blocks |
Filter the list of detected blocks on the page |
$blocks (array) |
Array of block names |
aegis_font_families |
Filter the font families loaded |
$fonts (array) |
Array of font definitions |
| Filter | Description | Parameters | Return |
|---|---|---|---|
aegis_template_parts |
Filter available template parts |
$parts (array) |
Array of template part definitions |
aegis_block_patterns |
Filter registered block patterns |
$patterns (array) |
Array of pattern definitions |
aegis_style_variations |
Filter available style variations |
$variations (array) |
Array of variation paths |
| Filter | Description | Parameters | Return |
|---|---|---|---|
aegis_analytics_providers |
Filter active analytics providers |
$providers (array) |
Array of provider configs |
aegis_analytics_consent_required |
Whether analytics require consent |
$required (bool) |
Boolean |
aegis_conditional_logic_conditions |
Filter available condition types |
$conditions (array) |
Array of condition definitions |
aegis_dark_mode_enabled |
Whether dark mode is enabled |
$enabled (bool) |
Boolean |
aegis_dark_mode_class |
The CSS class used for dark mode |
$class (string) |
CSS class name |
| Filter | Description | Parameters | Return |
|---|---|---|---|
aegis_block_categories |
Filter custom block categories |
$categories (array) |
Array of categories |
aegis_countdown_defaults |
Default attributes for Countdown block |
$defaults (array) |
Array of attributes |
aegis_slider_defaults |
Default attributes for Slider block |
$defaults (array) |
Array of attributes |
aegis_related_posts_query |
Filter the Related Posts query args |
$args (array), $post_id
|
WP_Query args array |
aegis_video_facade_enabled |
Whether video facade is active |
$enabled (bool), $block
|
Boolean |
| Filter | Description | Parameters | Return |
|---|---|---|---|
aegis_woocommerce_support |
Whether WooCommerce integration loads |
$enabled (bool) |
Boolean |
aegis_plugin_integrations |
Filter active plugin integrations |
$integrations (array) |
Array of integration slugs |
aegis_theme_updater_config |
Filter the auto-updater configuration |
$config (array) |
Array of updater settings |
add_action( 'aegis_after_post_content', function( $post_id ) {
if ( get_post_type( $post_id ) === 'post' ) {
echo '<div class="author-box">Written by ' . esc_html( get_the_author() ) . '</div>';
}
}, 10, 1 );add_filter( 'aegis_detected_blocks', function( $blocks ) {
// Always load countdown styles even if block is not in content
$blocks[] = 'aegis/countdown';
return $blocks;
} );add_filter( 'aegis_related_posts_query', function( $args, $post_id ) {
$args['posts_per_page'] = 6;
$args['orderby'] = 'rand';
return $args;
}, 10, 2 );// Disable dark mode site-wide
add_filter( 'aegis_dark_mode_enabled', '__return_false' );
// Disable WooCommerce integration
add_filter( 'aegis_woocommerce_support', '__return_false' );add_filter( 'aegis_theme_updater_config', function( $config ) {
$config['check_interval'] = 24 * HOUR_IN_SECONDS;
return $config;
} );| Priority | Usage |
|---|---|
| 1–9 | Early execution (before defaults) |
| 10 | Default priority |
| 11–20 | After default execution |
| 50+ | Late execution |
| 99+ | Very late (cleanup, final modifications) |
- hook-patterns — Using hooks for dynamic content injection.
- architecture — How hooks fit into the service architecture.
- conditional-logic — Condition-based block visibility.
- contributing — Contributing new hooks.
Aegis version 1.0.0 | GitHub Repository | Report an Issue | Atmostfear Entertainment
License: GPL-2.0-or-later