/** * Main Off-Canvas Sidebars Settings Instance. * * Ensures only one instance of this class is loaded or can be loaded. * * @since 0.3 * @static * @return OCS_Off_Canvas_Sidebars_Settings */ public static function get_instance() { if (is_null(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
/** * Init function/action to check current user, load nessesary data and classes, register hooks * * @return void * @since 0.1 */ function init() { // Get the current user //$this->curUser = wp_get_current_user(); // Load translations $this->load_textdomain(); // Register the enabled sidebars $this->register_sidebars(); if (is_admin()) { // Load the admin include_once 'includes/off-canvas-sidebars-settings.class.php'; OCS_Off_Canvas_Sidebars_Settings::get_instance(); // Add settings link to plugins page add_filter('plugin_action_links', array($this, 'add_settings_link'), 10, 2); } else { // If a sidebar is enabled, load the front-end if ($this->is_sidebar_enabled()) { include_once 'includes/off-canvas-sidebars-frontend.class.php'; OCS_Off_Canvas_Sidebars_Frontend::get_instance(); } } }