*/ public function get_parent_theme() { // Return the cached version of the theme if (is_a($this->theme, 'WP_Theme')) { return $this->theme; } $wp_get_theme = wp_get_theme(); return is_child_theme() ? $wp_get_theme->parent() : $wp_get_theme; } /** * This function returns the details of the current child theme (if any). */ public function get_child_theme() { // Return the cached version of the theme or null (if not a child theme) if (is_a($this->child_theme, 'WP_Theme') || $this->child_theme === null) { return $this->child_theme; } return is_child_theme() ? wp_get_theme() : null; } } /** * Create an instance of the Simple_Shop_Theme_Helper class. */ function Simple_Shop_Theme_Helper() { return Simple_Shop_Theme_Helper::instance(); } Simple_Shop_Theme_Helper();
/** * This function stores data in our transient and returns the data. */ function set_transient() { $simple_shop_theme_helper = Simple_Shop_Theme_Helper(); // Grab the Simple_Shop_Theme_Helper instance $data = array(); // Default // Always add the Customizer CSS $data['customizer_css'] = $this->get_customizer_css(); // Always add the theme's version $data['version'] = $simple_shop_theme_helper->theme->get('Version'); // Set the transient set_transient($this->transient_name, $data); return $data; }