2014-04-09 23:22:44 +03:00
|
|
|
<?php
|
2014-05-01 05:55:42 +03:00
|
|
|
|
2014-07-30 21:56:37 +03:00
|
|
|
/**
|
2014-08-01 23:47:08 +03:00
|
|
|
* The plugin bootstrap file
|
2014-04-11 17:36:57 +03:00
|
|
|
*
|
2014-08-19 23:06:09 +03:00
|
|
|
* This file is read by WordPress to generate the plugin information in the plugin
|
2015-02-13 20:31:40 +02:00
|
|
|
* admin area. This file also includes all of the dependencies used by the plugin,
|
2014-08-01 23:47:08 +03:00
|
|
|
* registers the activation and deactivation functions, and defines a function
|
2014-09-02 20:16:20 +03:00
|
|
|
* that starts the plugin.
|
2014-04-09 23:22:44 +03:00
|
|
|
*
|
2014-08-02 00:06:09 +03:00
|
|
|
* @link http://example.com
|
2014-07-30 21:56:37 +03:00
|
|
|
* @since 1.0.0
|
|
|
|
* @package Plugin_Name
|
2014-04-09 23:22:44 +03:00
|
|
|
*
|
|
|
|
* @wordpress-plugin
|
2014-05-05 07:16:52 +03:00
|
|
|
* Plugin Name: WordPress Plugin Boilerplate
|
2014-07-29 22:48:33 +03:00
|
|
|
* Plugin URI: http://example.com/plugin-name-uri/
|
2015-02-13 20:31:40 +02:00
|
|
|
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area.
|
2014-05-03 22:07:24 +03:00
|
|
|
* Version: 1.0.0
|
|
|
|
* Author: Your Name or Your Company
|
2014-07-29 22:48:33 +03:00
|
|
|
* Author URI: http://example.com/
|
2014-04-09 23:22:44 +03:00
|
|
|
* License: GPL-2.0+
|
|
|
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
2014-07-30 22:52:41 +03:00
|
|
|
* Text Domain: plugin-name
|
2014-04-09 23:22:44 +03:00
|
|
|
* Domain Path: /languages
|
|
|
|
*/
|
|
|
|
|
|
|
|
// If this file is called directly, abort.
|
|
|
|
if ( ! defined( 'WPINC' ) ) {
|
|
|
|
die;
|
2014-04-11 17:36:57 +03:00
|
|
|
}
|
|
|
|
|
2017-11-28 00:09:08 +02:00
|
|
|
/**
|
2017-12-07 10:59:48 +02:00
|
|
|
* Currently plugin version.
|
2017-11-28 00:09:08 +02:00
|
|
|
* 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.
|
|
|
|
*/
|
2017-09-27 17:13:29 +03:00
|
|
|
define( 'PLUGIN_NAME_VERSION', '1.0.0' );
|
2017-07-17 11:04:31 +03:00
|
|
|
|
2014-04-11 17:36:57 +03:00
|
|
|
/**
|
2014-07-29 22:48:33 +03:00
|
|
|
* The code that runs during plugin activation.
|
2014-11-17 14:33:00 +02:00
|
|
|
* This action is documented in includes/class-plugin-name-activator.php
|
2014-04-11 17:36:57 +03:00
|
|
|
*/
|
2014-11-17 14:33:00 +02:00
|
|
|
function activate_plugin_name() {
|
2014-11-19 14:25:59 +02:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-activator.php';
|
2014-11-17 14:33:00 +02:00
|
|
|
Plugin_Name_Activator::activate();
|
|
|
|
}
|
2014-04-11 17:36:57 +03:00
|
|
|
|
|
|
|
/**
|
2014-07-29 22:48:33 +03:00
|
|
|
* The code that runs during plugin deactivation.
|
2014-11-17 14:33:00 +02:00
|
|
|
* This action is documented in includes/class-plugin-name-deactivator.php
|
2014-04-11 17:36:57 +03:00
|
|
|
*/
|
2014-11-17 14:33:00 +02:00
|
|
|
function deactivate_plugin_name() {
|
2014-11-19 14:25:59 +02:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-deactivator.php';
|
2014-11-17 14:33:00 +02:00
|
|
|
Plugin_Name_Deactivator::deactivate();
|
|
|
|
}
|
2014-04-11 17:36:57 +03:00
|
|
|
|
2014-11-17 14:33:00 +02:00
|
|
|
register_activation_hook( __FILE__, 'activate_plugin_name' );
|
|
|
|
register_deactivation_hook( __FILE__, 'deactivate_plugin_name' );
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-05 07:16:52 +03:00
|
|
|
/**
|
2014-08-01 23:47:08 +03:00
|
|
|
* The core plugin class that is used to define internationalization,
|
2015-02-13 20:31:40 +02:00
|
|
|
* admin-specific hooks, and public-facing site hooks.
|
2014-05-05 07:16:52 +03:00
|
|
|
*/
|
2014-11-05 00:47:16 +02:00
|
|
|
require plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name.php';
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-05 07:16:52 +03:00
|
|
|
/**
|
2014-07-30 22:23:18 +03:00
|
|
|
* Begins execution of the plugin.
|
2014-06-26 23:19:57 +03:00
|
|
|
*
|
2014-07-30 22:23:18 +03:00
|
|
|
* 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.
|
2014-06-26 23:19:57 +03:00
|
|
|
*
|
|
|
|
* @since 1.0.0
|
2014-05-05 07:16:52 +03:00
|
|
|
*/
|
2014-05-09 06:33:47 +03:00
|
|
|
function run_plugin_name() {
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-09 06:33:47 +03:00
|
|
|
$plugin = new Plugin_Name();
|
|
|
|
$plugin->run();
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-09 06:33:47 +03:00
|
|
|
}
|
|
|
|
run_plugin_name();
|