function hocwp_theme_switcher_control($name) { $theme = hocwp_theme_switcher_get_current_theme(); if (!empty($theme)) { $name = $theme; } return $name; }
function hocwp_theme_switcher_plugins_loaded() { global $hocwp_theme_switcher_type, $hocwp_theme_switcher_time, $hocwp_plugin_theme_switcher; if (!$hocwp_plugin_theme_switcher->license_valid()) { return; } hocwp_session_start(); if (!empty($hocwp_theme_switcher_time)) { $hocwp_theme_switcher_time = time() + DAY_IN_SECONDS; } $theme = hocwp_theme_switcher_get_current_theme(); $find = wp_get_theme($theme); if (is_a($find, 'WP_Theme')) { add_filter('stylesheet', 'hocwp_theme_switcher_control'); add_filter('template', 'hocwp_theme_switcher_control'); } }