ChildTheme
Class.
Boots the framework for an active child theme with code of its own and provides its paths.
A child theme with blocks, hooks or routes is a framework instance of its
own: its slug is get_stylesheet(), its release prefixes its own copy of the
framework, and it talks to its parent theme only through the public API
(#[ThemeApi]) and public template callables of the parent. A child theme
that only overrides templates of its parent (overrides/{parent}/) needs no
boot and no build.
The instance is created only by boot() and handed to the container as a predefined instance: services of the child theme can inject it.
Methods
boot()
Boots the framework. Called once from the child theme's functions.php, which WordPress loads before the parent theme's.
Release mode applies if the child theme contains generated/manifest.php
(created only by the release build). Caches live in
wp-content/cache/{stylesheet}. Templates are looked up in the child
theme's src/, then in the framework. At its end, boot() fires the action
wp_app_framework/init/{stylesheet}.
getDirectory()
Directory of the child theme, as returned by get_stylesheet_directory().
Returns string
getDirectoryUri()
URI of the child theme directory, as returned by get_stylesheet_directory_uri().
Returns string
getFrameworkDirectory()
Filesystem path of the framework package; never derive URLs from it.
Returns string
getParentDirectory()
Directory of the parent theme, as returned by get_template_directory().
Returns string
getParentDirectoryUri()
URI of the parent theme directory, as returned by get_template_directory_uri().
Returns string
getParentSlug()
Directory name of the parent theme (get_template()).
Returns non-empty-string
getSlug()
Directory name of the child theme (get_stylesheet()); it names everything global of the framework instance.
Returns non-empty-string