Four-Layer Model
| Layer | Location | Responsibility |
|---|---|---|
| Theme | wp-content/themes/aegis | FSE templates, generic theme patterns (excluding WC/TI block patterns), fallback copies of the six Aegis blocks (until a later release removes them), thin PHP glue |
| Framework | vendor/aegis/framework | Core block enhancements, variations, design system engine, injection hook firing |
| Aegis Dash | wp-content/plugins/aegis-dash | Admin, the Aegis blocks (Map, Modal, Slider, Toggle, Countdown, Related Posts), snippets, conditionals, integrations, analytics, WooCommerce/TI Wishlist block patterns (gated) |
| Pro plugin | wp-content/plugins/aegis-pro | Hook pattern CPT, video stack, query pro, license, Pro patterns |
Template gating
FSE templates remain in the theme (templates/ + theme.json). WooCommerce and wishlist templates are hidden from the Site Editor template picker when dependencies are inactive via vendor/aegis/framework/src/DesignSystem/Templates.php (get_block_templates filter). See Template Reference.
Theme Overview
-
PSR-4 autoloading via Composer — namespace
Aegis\mapped tosrc/(theme glue + blocks) -
Framework bootstrap —
Aegis::register()fromvendor/aegis/framework -
Theme services —
CompanionNotice,GitHubUpdater,BlockRegistrar(fallback copies of the Aegis blocks fromblocks-manifest.php, registered only when Aegis Dash has not registered them; Related Posts and Slider extras localization, Related Posts pattern gating),NavigationFallback, andPatternDependencies(hides patterns whose blocks need an inactive plugin, and strips them from headers, when the editor loads patterns), all started insrc/bootstrap.php
Namespace Structure (src/)
Copied!Directory treesrc/├── bootstrap.php # Composer files autoload — starts the theme services below├── helpers.php # Pattern URL helpers (required from functions.php)├── NavigationFallback.php # block_core_navigation_render_fallback: sample menu instead of every page├── PatternDependencies.php # rest_pre_dispatch (patterns endpoint): hide patterns with blocks from inactive plugins├── Admin/│ ├── CompanionNotice.php # Install Aegis Dash notice (release zip)│ └── GitHubUpdater.php # update_themes_github.com: updates from GitHub releases└── Blocks/ # block.json + TSX sources (compiled in place) ├── BlockRegistrar.php ├── RelatedPostsQuery.php ├── ToggleId.php # Stable data-toggle-id for Toggle └── blocks-manifest.php # Generated by npm run build
Framework (vendor/aegis/framework)
Registered via ServiceProvider when Aegis::register() runs:
- 37+ core block render filters (
CoreBlocks\), includingcore/iconand Lightbox extras - Icon library registration (
Icons\Library) on WordPress 7.1+;wp aegis migrate-iconsfor leftover Image icons - Block settings (Visibility, Animation, Query enhancements, …). Visibility viewport/a11y extras add CSS classes to the block or post-content root; hook patterns wrap. Color Scheme follows
is-style-*anddefault-mode-*onbody. - Block variations (Accordion, Counter, Marquee, Newsletter, SVG Image — not Image Icon). Marquee extras are gated at Aegis → Blocks → Marquee. Accordion, Newsletter, and SVG styles register once in PHP (
register_style()), not viaBlockStyles. The SVG inspector issvg-editor.js(no SVGOMG Optimize control). - Design system (Patterns scanner, REST trim, template pattern expander, dynamic template parts, DarkMode, SkipLink, BlockStyles for decorative styles such as surface/checklist, EditorAssets, navigation overlay, editor overlay fix)
- Integration CSS (gated by plugin settings when the plugin is active), including Meta Box form styling (
plugins/meta-box.css), Easy Digital Downloads download/checkout styling (plugins/edd/edd.css), AffiliateWP Affiliate Area and login/register form styling (plugins/affiliate-wp.css), Fluent Forms form element and button styling (plugins/fluent-forms.css, injected onfluentform/ff_form/fluent_form/fluent-form/ff-form), Fluent Booking calendar and appointment styling (plugins/fluentbooking.css, injected onfluent-booking/fcal_/fcal-/fluentbooking), Gravity Forms form element, input, and button styling (plugins/gravity-forms.css, injected ongform_wrapper/gravity-theme/gform/gform_body/gform-body/gfield), WooCommerce shop/cart/checkout styling (plugins/woocommerce/woocommerce.css) and breadcrumbs (plugins/woocommerce/woocommerce-breadcrumbs.css, injected onwoocommerce-breadcrumb/wc-block-breadcrumbs/wp-block-woocommerce-breadcrumbs). Classic and Store Breadcrumb delimiters wrap in.aegis-breadcrumb-separator(woocommerce_breadcrumb_defaultsandrender_block_woocommerce/breadcrumbs). Also the Code Block Pro overlay (plugins/code-block-pro.css), and the Syntax Highlighting Code Block overlay (plugins/syntax-highlighting-code-block.css, injected onhljs/shcb-) - Injection hook firing on template parts and post content
Bootstrap Flow
1. functions.php
Loads Composer autoload, helpers, textdomain, and Aegis::register().
2. src/bootstrap.php
Initializes CompanionNotice, GitHubUpdater, BlockRegistrar, NavigationFallback, and PatternDependencies. Adds style.css as an editor style. Icon packs under vendor/aegis/icons/public/icons/ (including payment) are discovered automatically.
3. Aegis::register()
Boots the framework ServiceProvider (design system, core blocks, integrations).
What Moved to Plugins
These features are not in theme PHP — see plugin docs:
| Feature | Documentation |
|---|---|
| Analytics | Aegis Dash Analytics |
| Conditionals admin/evaluator | Conditional Logic |
| Admin dashboard | Aegis Dash Architecture |
| Multi-step checkout | WooCommerce Checkout |
| Integrations dashboard | Integrations Dashboard |
| Hook pattern CPT | Pro Hook Patterns |
| Map / Modal blocks | Aegis Dash Custom Blocks |
Build Pipeline
Dual build — see Building Assets:
-
Theme:
npm run build→ compiled assets insrc/Blocks/(the theme’s fallback copies of the six blocks) -
Aegis Dash:
npm run buildinwp-content/plugins/aegis-dash(admin app and the six TypeScript blocks; Map and Modal are hand-maintained)
Next Steps
- File Structure — Directory layout
- Building Assets — Build commands
- Aegis Dash Architecture