Global Functions
These functions are defined in the global namespace underBifrost\Noise.
theme()
Returns the theme application instance. This is the primary entry point for accessing the theme’s application container and services. Location: src/functions-helpers.php:22container()
Helper function for quickly accessing the service container. Developers can access any concrete implementation by passing in a reference to its abstract identifier. Location: src/functions-helpers.php:39Application Methods
TheApplication class (extended by Theme) provides the following public methods:
container()
Get the container instance. Location: src/Core/Application.php:85register()
Register a service provider with the application. Location: src/Core/Application.php:93$provider(ServiceProvider|string) - Service provider instance or class name
boot()
Boots all service providers that implement theBootable interface. This is called automatically on the after_setup_theme hook.
Location: src/Core/Application.php:113
Container Methods
The service container provides dependency injection capabilities:get()
Resolve a service from the container.$abstract(string) - The service class name or identifier
has()
Check if a service is bound in the container.$abstract(string) - The service class name or identifier
singleton()
Register a singleton binding in the container.$abstract(string) - The service identifier$concrete(Closure|string|null) - The implementation or factory closure
instance()
Register an existing instance in the container.$abstract(string) - The service identifier$instance(mixed) - The instance to bind
Service Classes
Block Binding Sources
BindingSource (Abstract)
Base class for creating custom block binding sources. Location: src/Block/Binding/BindingSource.php Methods:Sources\Album- Album metadata bindings (src/Block/Binding/Sources/Album.php)Sources\PostType- Post type metadata bindings (src/Block/Binding/Sources/PostType.php)Sources\Query- Query context bindings (src/Block/Binding/Sources/Query.php)Sources\Term- Taxonomy term bindings (src/Block/Binding/Sources/Term.php)Sources\User- User metadata bindings (src/Block/Binding/Sources/User.php)
Post Type Modifiers
PostTypeModifier (Abstract)
Base class for modifying post type registration arguments. Location: src/PostType/PostTypeModifier.php Methods:Modifiers\Album- Modifiesmusic_albumpost type (src/PostType/Modifiers/Album.php)Modifiers\Artist- Modifiesmusic_artistpost type (src/PostType/Modifiers/Artist.php)Modifiers\Post- Modifiespostpost type (src/PostType/Modifiers/Post.php)
PostTypeModifierRegistry
Registry for post type modifiers. Location: src/PostType/PostTypeModifierRegistry.php Methods:Stylesheet Management
Stylesheet
Represents a block-specific stylesheet. Location: src/Block/Stylesheet/Stylesheet.php Methods:StylesheetIterator
Discovers and iterates over block stylesheets. Location: src/Block/Stylesheet/StylesheetIterator.php Usage:Theme Constants
TheTheme class defines the following constants:
NAMESPACE
The theme’s namespace used as a hook prefix. Location: src/Theme.php:27bifrost/noise/registerbifrost/noise/booted
PROVIDERS
The theme’s default service providers. Location: src/Theme.php:32-41WordPress Helper Functions Used
The theme utilizes standard WordPress functions throughout. Key functions include:Theme File Functions
Script/Style Functions
Block Binding Functions
Theme Support Functions
Creating Custom Services
To create a custom service and register it with the theme:Step 1: Create a Service Provider
Step 2: Create Your Service
Step 3: Register the Provider
See Also
Theme Hooks
Actions and filters available in the theme
Theme Overview
Learn about the theme’s architecture
