Backdrop is a framework for developing themes & plugins for ClassicPress and WordPress.
Backdrop is the core application layer that consists of a service container and it can be use alone or alongside with Backdrop's available packages.
Use the following command from your preferred command line utility to install Backdrop.
composer require backdrop-dev/framework
if bundling this directly in your theme, add the following code.
if ( file_exists( get_parent_theme_file_path( 'vendor/autoload.php' ) ) ) {
require_once( get_parent_theme_file_path( 'vendor/autoload.php' ) );
}
if bundling this directly in your plugin, add the following code.
if ( file_exists( plugin_dir_path( __FILE__ ) . '/vendor/autoload.php' ) ) {
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload.php';
}
Please note that the Backdrop isn't launched until an instance of its Backdrop\Core\Application class is created and its boot(), check the Backdrop\booted() function before attempting to create a new app. If one exists, then it should use the existing instance via the Backdrop\app() helper function.
// Create a new application $slug = Backdrop\booted ? Backdrop\app() : new Backdrop\Core\Application(); // Add service provider $slug->provider( YourProject\Provider::class ); // Create and action hook for child themes or plugins do_action( "$slug/child/theme", $slug ); // Boot the application $slug->boot();
This project is licensed under the GNU GPL, version 2 or later.
2019–2025 © Benjamin Lu