ControlledChaos
4/20/2016 - 6:58 PM

[WordPress] A template for the WordPress plugin bootstrap file to be used when creating WordPress plugins.

[WordPress] A template for the WordPress plugin bootstrap file to be used when creating WordPress plugins.

<?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              URL to plugin homepage
 * @since             1.0.0
 * @package           TODO
 *
 * @wordpress-plugin
 * Plugin Name:       Name of the plugin
 * Plugin URI:        URL to the homepage of the plugin
 * Description:       Short description of the plugin
 * Version:           1.0.0
 * Author:            Your name
 * Author URI:        Your company's URL
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 */

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	 die;
}

/**
 * Includes the class that provides the functionality for the plugin. 
 *
 * Note: This could be done with PHP autoloading depending on your version 
 * of PHP.
 */
include_once( 'class-demo-plugin.php' );

/**
 * Instantiates the plugin and and initializes the functionality necessary for
 * WordPress.
 *
 * @since 1.0.0
 */
function acme_demo_plugin() {

	$plugin = new Demo_Plugin();
	$plugin->init();

}
acme_demo_plugin();