function tsrb() { $plugin = _get_the_plugin(__FILE__); $_token = $plugin['TextDomain']; $_version = $plugin['Version']; /** * Constants * Uncomment if necessary * @since 1.0.0 **/ /*if ( ! defined( 'CONST' ) ) define( 'CONST', 'a constant value' );*/ /** * File inclusion * @since 1.0.0 **/ require_once 'includes/class-' . $_token . '.php'; // activate addons one by one from modules directory foreach (glob(dirname(__FILE__) . '/includes/modules/*.php') as $module) { require_once $module; } /** * Returns the main instance of pn to prevent the need to use globals. * * @since 1.0.0 * @return object pn */ $instance = tsrb::instance(__FILE__, $_token, $_version); $instance->ptshortcode = TS_PTShortcode::instance($instance); $instance->ptshortcodeajax = TS_PTShortcodeajax::instance($instance); $instance->rcshortcode = TS_RippleButton::instance($instance); return $instance; }
/** * Object Instance and Inheritance * * Ensures only one instance of class is loaded or can be loaded. * * @since 1.0.0 * @static * @see __construct() * @return Object Instance and Inheritance */ public static function instance($parent) { if (is_null(self::$_instance)) { self::$_instance = new self($parent); } return self::$_instance; }