/** * Initialize the plugin. * * @since 1.0.0 */ private function __construct() { /** * Call $plugin_slug from public plugin class. */ $plugin = SDS_One_Click_Child_Themes::get_instance(); $this->plugin_slug = $plugin->get_plugin_slug(); // Initialize Theme Data $this->current_parent_theme = $this->get_current_parent_theme(); $this->current_child_theme = $this->get_current_child_theme(); $this->installed_child_themes = $this->get_installed_child_themes($this->current_parent_theme); }
/** * Initialize the plugin * * @since 1.0.0 */ private function __construct() { /** * Call $plugin_slug from public plugin class. */ $plugin = SDS_One_Click_Child_Themes::get_instance(); $this->plugin_slug = $plugin->get_plugin_slug(); add_filter('puc_request_info_query_args-sds-one-click-child-themes', array($this, 'sds_occt_update_query_args')); add_filter('puc_request_info_result-sds-one-click-child-themes', array($this, 'sds_occt_request_info_result'), 10, 2); add_action('admin_init', array($this, 'admin_init')); // Remove update notices if the versions are synced add_action('wp_dashboard_setup', array($this, 'wp_dashboard_setup')); // Create dashboard notification for updates add_action('wp_ajax_dismiss_sds_occt_update_notification', array($this, 'wp_ajax_dismiss_sds_occt_update_notification')); // Handle AJAX request for dismissing notifications }
/** * Initialize the plugin by loading admin assets. * * @since 1.0.0 */ private function __construct() { /** * Call $plugin_slug and $is_multisite from public plugin class. */ $plugin = SDS_One_Click_Child_Themes::get_instance(); $this->plugin_slug = $plugin->get_plugin_slug(); $this->is_multisite = $plugin->is_multisite; // Load admin stylesheet and JavaScript add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts')); // Add navigation tabs to the Theme Options panel add_action('sds_theme_options_navigation_tabs', array($this, 'sds_theme_options_navigation_tabs')); // Add settings to the Theme Options panel add_action('sds_theme_options_settings', array($this, 'sds_theme_options_settings')); // Sanitize/Validate settings on the Theme Options panel add_filter('sanitize_option_sds_theme_options', array($this, 'sanitize_option_sds_theme_options')); }
/** * Return an instance of this class. * * @since 1.0.0 * * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }