benecaster_boot
The add-on bootstrap point. Fires at the end of Plugin::boot() once core services are registered and the upgrader has run, passing the dependency injection container. This is where every Benecaster add-on hooks its own initialization — registering services, shortcodes, REST routes, and filter callbacks.
Hook here rather than on WordPress’s plugins_loaded or init. At benecaster_boot the container is populated and core services are resolvable; earlier than this they are not.
Registries that add-ons contribute to are applied immediately after this action fires, so a callback registered inside your benecaster_boot handler is in place before the registry is read. Registering later — on init, for example — is too late for those registries and the contribution is silently ignored.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$container |
object |
— | The Benecaster DI container; use `make()` to resolve core services. |
Examples
Boot an add-on
add_action( 'benecaster_boot', function ( $container ): void {
( new My_Addon\Plugin( $container ) )->register();
} );
Notes
Add-ons that check license entitlement should do so inside this callback rather than at file load time — the license services are not resolvable before the container is built.