Using namespaces
This commit is contained in:
@ -1,15 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use PluginNamespace\App;
|
||||||
|
use eftec\bladeone\BladeOne;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Boilerplate Plugin
|
* Boilerplate Plugin v2
|
||||||
*
|
*
|
||||||
* @package BoilerplatePlugin
|
* @package BoilerplatePluginv2
|
||||||
* @author Plugin Author
|
* @author Plugin Author
|
||||||
* @copyright GPL v2
|
* @copyright GPL v2
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
|
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
|
||||||
*
|
*
|
||||||
* @wordpress-plugin
|
* @wordpress-plugin
|
||||||
* Plugin Name: Boilerplate Plugin
|
* Plugin Name: Boilerplate Plugin v2
|
||||||
* Description: Your plugin description.
|
* Description: Your plugin description.
|
||||||
* License: GPL v2
|
* License: GPL v2
|
||||||
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
|
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
|
||||||
@ -46,10 +49,10 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
|||||||
require_once __DIR__ . '/includes/class-nmspcli.php';
|
require_once __DIR__ . '/includes/class-nmspcli.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
$mode = \eftec\bladeone\BladeOne::MODE_AUTO; // Can also be MODE_DEBUG
|
$mode = BladeOne::MODE_DEBUG; // Can also be MODE_AUTO|MODE_DEBUG
|
||||||
$blade = new \eftec\bladeone\BladeOne( __DIR__ . '/templates', __DIR__ . '/cache/blade', $mode );
|
$blade = new BladeOne( __DIR__ . '/templates', __DIR__ . '/cache/blade', $mode );
|
||||||
|
|
||||||
register_activation_hook( __FILE__, array( \PluginNamespace\App::class, 'plugin_activation' ) );
|
register_activation_hook( __FILE__, array( App::class, 'plugin_activation' ) );
|
||||||
register_deactivation_hook( __FILE__, array( \PluginNamespace\App::class, 'plugin_deactivation' ) );
|
register_deactivation_hook( __FILE__, array( App::class, 'plugin_deactivation' ) );
|
||||||
|
|
||||||
nmsp_plugin_app()->load_blade( $blade );
|
nmsp_plugin_app()->load_blade( $blade );
|
||||||
|
Reference in New Issue
Block a user