2011-07-12 00:37:07 +03:00
|
|
|
<?php
|
2013-05-12 15:57:18 +03:00
|
|
|
/**
|
|
|
|
* The WordPress Plugin Boilerplate.
|
|
|
|
*
|
2013-10-17 23:22:14 +03:00
|
|
|
* A foundation off of which to build well-documented WordPress plugins that
|
|
|
|
* also follow WordPress Coding Standards and PHP best practices.
|
2013-05-12 15:57:18 +03:00
|
|
|
*
|
2013-07-07 21:03:25 +03:00
|
|
|
* @package Plugin_Name
|
2013-05-16 16:40:25 +03:00
|
|
|
* @author Your Name <email@example.com>
|
|
|
|
* @license GPL-2.0+
|
2013-05-16 16:56:20 +03:00
|
|
|
* @link http://example.com
|
2013-05-16 16:40:25 +03:00
|
|
|
* @copyright 2013 Your Name or Company Name
|
2013-05-12 15:57:18 +03:00
|
|
|
*
|
|
|
|
* @wordpress-plugin
|
2013-11-16 19:30:18 +02:00
|
|
|
* Plugin Name: @TODO
|
|
|
|
* Plugin URI: @TODO
|
|
|
|
* Description: @TODO
|
2013-10-17 23:22:14 +03:00
|
|
|
* Version: 1.0.0
|
2013-11-16 19:30:18 +02:00
|
|
|
* Author: @TODO
|
|
|
|
* Author URI: @TODO
|
2013-10-17 23:22:14 +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
|
2013-10-16 23:38:25 +03:00
|
|
|
* GitHub Plugin URI: https://github.com/<owner>/<repo>
|
2014-03-26 17:47:51 +02:00
|
|
|
* WordPress-Plugin-Boilerplate: v2.6.1
|
2013-05-12 15:57:18 +03:00
|
|
|
*/
|
2011-07-12 00:37:07 +03:00
|
|
|
|
2013-05-13 13:38:57 +03:00
|
|
|
// If this file is called directly, abort.
|
2013-05-15 17:00:38 +03:00
|
|
|
if ( ! defined( 'WPINC' ) ) {
|
|
|
|
die;
|
2013-05-12 00:38:50 +03:00
|
|
|
}
|
|
|
|
|
2013-11-08 23:54:33 +02:00
|
|
|
/*----------------------------------------------------------------------------*
|
|
|
|
* Public-Facing Functionality
|
|
|
|
*----------------------------------------------------------------------------*/
|
2013-10-30 22:50:09 +02:00
|
|
|
|
2013-10-17 23:22:14 +03:00
|
|
|
/*
|
2013-11-16 19:30:18 +02:00
|
|
|
* @TODO:
|
2013-10-17 23:22:14 +03:00
|
|
|
*
|
|
|
|
* - replace `class-plugin-name.php` with the name of the plugin's class file
|
|
|
|
*
|
|
|
|
*/
|
2013-11-15 13:35:07 +02:00
|
|
|
require_once( plugin_dir_path( __FILE__ ) . 'public/class-plugin-name.php' );
|
2012-07-14 05:14:34 +03:00
|
|
|
|
2013-10-17 23:22:14 +03:00
|
|
|
/*
|
|
|
|
* Register hooks that are fired when the plugin is activated or deactivated.
|
|
|
|
* When the plugin is deleted, the uninstall.php file is loaded.
|
|
|
|
*
|
2013-11-16 19:30:18 +02:00
|
|
|
* @TODO:
|
2013-11-08 23:54:33 +02:00
|
|
|
*
|
|
|
|
* - replace Plugin_Name with the name of the class defined in
|
|
|
|
* `class-plugin-name.php`
|
2013-10-17 23:22:14 +03:00
|
|
|
*/
|
2013-11-08 23:54:33 +02:00
|
|
|
register_activation_hook( __FILE__, array( 'Plugin_Name', 'activate' ) );
|
|
|
|
register_deactivation_hook( __FILE__, array( 'Plugin_Name', 'deactivate' ) );
|
2013-05-13 15:43:08 +03:00
|
|
|
|
2013-11-08 23:54:33 +02:00
|
|
|
/*
|
2013-11-16 19:30:18 +02:00
|
|
|
* @TODO:
|
2013-11-08 23:54:33 +02:00
|
|
|
*
|
|
|
|
* - replace Plugin_Name with the name of the class defined in
|
|
|
|
* `class-plugin-name.php`
|
|
|
|
*/
|
|
|
|
add_action( 'plugins_loaded', array( 'Plugin_Name', 'get_instance' ) );
|
2013-10-30 22:27:26 +02:00
|
|
|
|
2013-10-30 22:50:09 +02:00
|
|
|
/*----------------------------------------------------------------------------*
|
|
|
|
* Dashboard and Administrative Functionality
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*
|
2013-11-16 19:30:18 +02:00
|
|
|
* @TODO:
|
2013-11-08 23:54:33 +02:00
|
|
|
*
|
|
|
|
* - replace `class-plugin-admin.php` with the name of the plugin's admin file
|
|
|
|
* - replace Plugin_Name_Admin with the name of the class defined in
|
|
|
|
* `class-plugin-name-admin.php`
|
2013-11-01 15:53:10 +02:00
|
|
|
*
|
2013-10-30 22:50:09 +02:00
|
|
|
* If you want to include Ajax within the dashboard, change the following
|
|
|
|
* conditional to:
|
|
|
|
*
|
|
|
|
* if ( is_admin() ) {
|
|
|
|
* ...
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* The code below is intended to to give the lightest footprint possible.
|
|
|
|
*/
|
2013-10-30 22:27:26 +02:00
|
|
|
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
|
2013-10-30 22:50:09 +02:00
|
|
|
|
2013-11-15 13:35:07 +02:00
|
|
|
require_once( plugin_dir_path( __FILE__ ) . 'admin/class-plugin-name-admin.php' );
|
2013-11-08 23:54:33 +02:00
|
|
|
add_action( 'plugins_loaded', array( 'Plugin_Name_Admin', 'get_instance' ) );
|
2013-10-30 22:50:09 +02:00
|
|
|
|
2013-11-01 15:53:10 +02:00
|
|
|
}
|