Skip to content

Instantly share code, notes, and snippets.

@curtismchale
Created May 4, 2023 13:31
Show Gist options
  • Save curtismchale/9b20f430942b042e121a8570db775881 to your computer and use it in GitHub Desktop.
Save curtismchale/9b20f430942b042e121a8570db775881 to your computer and use it in GitHub Desktop.
Singleton Class
<?php
class SFN_Group_WP_Admin extends SFN_Group_Purchase_PMPRO{
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 SFN_Group_WP_Admin();
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
*/
public function init(){
} // init
}
SFN_Group_WP_Admin::instance();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment