Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Base plugin for creating automate woo triggers
<?php
/*
Plugin Name: Nexcess - AutomateWoo Triggers
Plugin URI: https://nexcess.net
Description: Adds custom triggers to AutomateWoo
Version: 1.0
Author: SFNdesign, Curtis McHale
Author URI: http://sfndesign.ca
License: GPLv2 or later
*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Nexcess_Automatewoo_Triggers{
private static $instance;
/**
* Spins up the instance of the plugin so that we don't get many instances running at once
*
* @since 1.0
* @author SFNdesign, Curtis McHale
*
* @uses $instance->init() The main get it running function
*/
public static function instance(){
if ( ! self::$instance ){
self::$instance = new Nexcess_Automatewoo_Triggers();
self::$instance->init();
}
} // instance
/**
* Spins up all the actions/filters in the plugin to really get the engine running
*
* @since 1.0
* @author SFNdesign, Curtis McHale
*
* @uses $this->constants() Defines our constants
* @uses $this->includes() Gets any includes we have
*/
public function init(){
$this->constants();
$this->includes();
} // init
/**
* Gives us any constants we need in the plugin
*
* @since 1.0
*/
public function constants(){
define( 'NEXCESS_AUTOMATEWOO_TRIGGERS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
/**
* Includes any externals
*
* @since 1.0
* @author SFNdesign, Curtis McHale
* @access public
*/
public function includes(){
}
} // Nexcess_Automatewoo_Triggers
Nexcess_Automatewoo_Triggers::instance();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment