An updated version of the plugin template workflow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
<?php /** * Plugin Name: ___PLUGIN_NAME___ * Plugin URI: ___PLUGIN_URL___ * Description: ___PLUGIN_DESCRIPTION___ * Version: 1.0.0 * Author: ___PLUGIN_AUTHOR___ * Author URI: ___PLUGIN_URL___ * License: GPLv3 */ defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); $protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,strpos( $_SERVER["SERVER_PROTOCOL"],'/'))).'://'; define('SITE_URL', $protocol . $_SERVER['SERVER_NAME']); /** * ========== Load the functions required by the plugin ========== */ include_once(plugin_dir_path(__FILE__) . "___PLUGIN_NAME___-lib.php"); include_once(plugin_dir_path(__FILE__) . "___PLUGIN_NAME___-admin.php"); /** * ========== Register various hooks and actions for the plugin ========== */ ___PLUGIN_NAME___register_hooks(); /** * ========== Admin Access Only ========== */ if(is_admin()){ /** * ========== Register all Javascripts ========== */ ___PLUGIN_NAME___register_js(); /** * ========== Add options to admin panel ========== */ ___PLUGIN_NAME___admin_page(); } |