mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-23 04:13:53 +02:00
5391e0ca27
Flattening the folder structure for a bit easier auto-inclusion into projects and local development. See: https://github.com/DevinVinson/WordPress-Plugin-Boilerplate/issues/295
75 lines
2.2 KiB
PHP
75 lines
2.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* The plugin bootstrap file
|
|
*
|
|
* This file is read by WordPress to generate the plugin information in the plugin
|
|
* admin area. This file also includes all of the dependencies used by the plugin,
|
|
* registers the activation and deactivation functions, and defines a function
|
|
* that starts the plugin.
|
|
*
|
|
* @link http://example.com
|
|
* @since 1.0.0
|
|
* @package Plugin_Name
|
|
*
|
|
* @wordpress-plugin
|
|
* Plugin Name: WordPress Plugin Boilerplate
|
|
* Plugin URI: http://example.com/plugin-name-uri/
|
|
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
|
|
* Version: 1.0.0
|
|
* Author: Your Name or Your Company
|
|
* Author URI: http://example.com/
|
|
* License: GPL-2.0+
|
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
|
* Text Domain: plugin-name
|
|
* Domain Path: /languages
|
|
*/
|
|
|
|
// If this file is called directly, abort.
|
|
if ( ! defined( 'WPINC' ) ) {
|
|
die;
|
|
}
|
|
|
|
/**
|
|
* The code that runs during plugin activation.
|
|
* This action is documented in includes/class-plugin-name-activator.php
|
|
*/
|
|
function activate_plugin_name() {
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-activator.php';
|
|
Plugin_Name_Activator::activate();
|
|
}
|
|
|
|
/**
|
|
* The code that runs during plugin deactivation.
|
|
* This action is documented in includes/class-plugin-name-deactivator.php
|
|
*/
|
|
function deactivate_plugin_name() {
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-deactivator.php';
|
|
Plugin_Name_Deactivator::deactivate();
|
|
}
|
|
|
|
register_activation_hook( __FILE__, 'activate_plugin_name' );
|
|
register_deactivation_hook( __FILE__, 'deactivate_plugin_name' );
|
|
|
|
/**
|
|
* The core plugin class that is used to define internationalization,
|
|
* admin-specific hooks, and public-facing site hooks.
|
|
*/
|
|
require plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name.php';
|
|
|
|
/**
|
|
* Begins execution of the plugin.
|
|
*
|
|
* Since everything within the plugin is registered via hooks,
|
|
* then kicking off the plugin from this point in the file does
|
|
* not affect the page life cycle.
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
function run_plugin_name() {
|
|
|
|
$plugin = new Plugin_Name();
|
|
$plugin->run();
|
|
|
|
}
|
|
run_plugin_name();
|