2014-04-09 23:22:44 +03:00
|
|
|
<?php
|
2014-05-01 05:55:42 +03:00
|
|
|
|
2014-04-09 23:22:44 +03:00
|
|
|
/**
|
2014-04-26 02:00:08 +03:00
|
|
|
* Short Description (no period for file headers)
|
2014-04-11 17:36:57 +03:00
|
|
|
*
|
2014-04-26 02:00:08 +03:00
|
|
|
* Long Description.
|
2014-04-09 23:22:44 +03:00
|
|
|
*
|
2014-05-03 22:07:24 +03:00
|
|
|
* @package Plugin_Name
|
|
|
|
* @author Your Name or Company Name <email@domain.com>
|
|
|
|
* @license GPL-2.0+
|
|
|
|
* @link http://exmaple.com/plugin-name
|
|
|
|
* @copyright 2014 Your Name or Company Name
|
2014-04-09 23:22:44 +03:00
|
|
|
*
|
|
|
|
* @wordpress-plugin
|
2014-05-05 07:16:52 +03:00
|
|
|
* Plugin Name: WordPress Plugin Boilerplate
|
|
|
|
* Plugin URI: http://example.com/plugin-name-uri
|
2014-05-03 22:07:24 +03:00
|
|
|
* Description: This is a short description of what the plugin does. It's displayed in the WordPress dashboard.
|
|
|
|
* Version: 1.0.0
|
|
|
|
* Author: Your Name or Your Company
|
|
|
|
* Author URI: http://example.com
|
2014-04-09 23:22:44 +03:00
|
|
|
* Text Domain: plugin-name-locale
|
|
|
|
* License: GPL-2.0+
|
|
|
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
|
|
|
* Domain Path: /languages
|
|
|
|
*/
|
|
|
|
|
|
|
|
// If this file is called directly, abort.
|
|
|
|
if ( ! defined( 'WPINC' ) ) {
|
|
|
|
die;
|
2014-04-11 17:36:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Includes the plugin activation class that runs during plugin activation.
|
|
|
|
*/
|
2014-04-27 00:42:21 +03:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-activator.php';
|
2014-04-11 17:36:57 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Includes the plugin deactivation class that runs during plugin deactivation.
|
|
|
|
*/
|
2014-04-27 00:42:21 +03:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-deactivator.php';
|
2014-04-11 17:36:57 +03:00
|
|
|
|
2014-05-05 07:16:52 +03:00
|
|
|
/**
|
|
|
|
* The base class used to define certain functionality and attributes shared among
|
|
|
|
* all shared subclasses of the core plugin file.
|
|
|
|
*/
|
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name.php';
|
|
|
|
|
2014-04-11 17:36:57 +03:00
|
|
|
/** This action is documented in includes/class-plugin-name-activator.php */
|
|
|
|
register_activation_hook( __FILE__, array( 'Plugin_Name_Activator', 'activate' ) );
|
|
|
|
|
|
|
|
/** This action is documented in includes/class-plugin-name-deactivator.php */
|
2014-04-26 01:39:31 +03:00
|
|
|
register_activation_hook( __FILE__, array( 'Plugin_Name_Deactivator', 'deactivate' ) );
|
2014-05-03 22:26:22 +03:00
|
|
|
|
|
|
|
/**
|
2014-05-05 07:16:52 +03:00
|
|
|
* Includes the class responsible for defining the core functionality of the
|
|
|
|
* shared components of the plugin.
|
2014-05-03 22:26:22 +03:00
|
|
|
*/
|
2014-05-05 07:16:52 +03:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-loader.php';
|
|
|
|
$loader = new Plugin_Name_Loader();
|
2014-05-03 22:26:22 +03:00
|
|
|
|
|
|
|
/**
|
2014-05-05 07:16:52 +03:00
|
|
|
* Includes the class responsible for defining internationalization functionality
|
|
|
|
* of the plugin.
|
2014-05-03 22:26:22 +03:00
|
|
|
*/
|
2014-05-05 07:16:52 +03:00
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name-i18n.php';
|
|
|
|
$plugin_i18n = new Plugin_Name_i18n();
|
|
|
|
$loader->add( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-05 07:16:52 +03:00
|
|
|
/**
|
|
|
|
* TODO
|
|
|
|
*/
|
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'admin/class-plugin-name-admin.php';
|
|
|
|
$plugin_name_admin = new Plugin_Name_Admin();
|
|
|
|
$loader->add( 'admin_enqueue_scripts', $plugin_name_admin, 'enqueue_styles' );
|
|
|
|
$loader->add( 'admin_enqueue_scripts', $plugin_name_admin, 'enqueue_scripts' );
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-05 07:16:52 +03:00
|
|
|
/**
|
|
|
|
* TODO
|
|
|
|
*/
|
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'public/class-plugin-name-public.php';
|
|
|
|
$plugin_name_public = new Plugin_Name_Public();
|
|
|
|
$loader->add( 'wp_enqueue_scripts', $plugin_name_public, 'enqueue_styles' );
|
|
|
|
$loader->add( 'wp_enqueue_scripts', $plugin_name_public, 'enqueue_scripts' );
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-05 07:16:52 +03:00
|
|
|
/**
|
|
|
|
* TODO
|
|
|
|
*/
|
|
|
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-plugin-name.php';
|
|
|
|
$plugin = new Plugin_Name( $loader );
|
2014-05-03 22:26:22 +03:00
|
|
|
|
2014-05-05 07:16:52 +03:00
|
|
|
$plugin->run();
|