Skip to content

backdrop-dev/framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

842 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backdrop: Themes & Plugins Framework

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.

Requirements

Installation

Use the following command from your preferred command line utility to install Backdrop.

composer require backdrop-dev/framework

Themes

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' ) );
}

Plugins

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';
}

Registering and Booting Backdrop.

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();

Copyright and Licenses

This project is licensed under the GNU GPL, version 2 or later.

2019–2025 © Benjamin Lu

About

Backdrop Framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages