wp-plugin-boilerplate/nmsp-plugin-name.php

69 lines
1.9 KiB
PHP

<?php
use PluginNamespace\App;
use eftec\bladeone\BladeOne;
/**
* Boilerplate Plugin v2
*
* @package BoilerplatePlugin
* @author Plugin Author
* @copyright GPLv3
* @license https://www.gnu.org/licenses/gpl-3.0.en.html
*
* @wordpress-plugin
* Plugin Name: Boilerplate Plugin
* Description: Your plugin description.
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
* Plugin URI: https://domain.com
* Update URI: https://example.com/my-plugin/
* Version: 1.0.0
* Requires at least: 5.2
* Requires PHP: 8.1
* Author: Plugin Author
* Author URI: https://plugin-author.com
* Text Domain: nmsp-plugin-name-text-domain
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Currently plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
if ( ! defined( 'PLUGIN_NAME_VERSION' ) ) {
define( 'PLUGIN_NAME_VERSION', '1.0.0' );
}
if ( ! defined( 'PLUGIN_NAME_DB_VERSION' ) ) {
define( 'PLUGIN_NAME_DB_VERSION', '1.0.0' );
}
if ( ! defined( 'NMSP_PLUGIN_BASE_DIR' ) ) {
define( 'NMSP_PLUGIN_BASE_DIR', __DIR__ );
}
if ( ! defined( 'NMSP_PLUGIN_BASE_FILE' ) ) {
define( 'NMSP_PLUGIN_BASE_FILE', __FILE__ );
}
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/bootstrap.php';
// include the CLI utility of this plugin if WordPress has CLI functionality
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once __DIR__ . '/includes/class-nmspcli.php';
}
$blade = new BladeOne( __DIR__ . '/templates', __DIR__ . '/cache/blade' );
register_activation_hook( __FILE__, array( App::class, 'plugin_activation' ) );
register_deactivation_hook( __FILE__, array( App::class, 'plugin_deactivation' ) );
nmsp_plugin_app()->load_blade( $blade );