Title: zwalker's Replies | WordPress.org

---

# zwalker

  [  ](https://wordpress.org/support/users/zwalker/)

 *   [Profile](https://wordpress.org/support/users/zwalker/)
 *   [Topics Started](https://wordpress.org/support/users/zwalker/topics/)
 *   [Replies Created](https://wordpress.org/support/users/zwalker/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/zwalker/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/zwalker/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/zwalker/engagements/)
 *   [Favorites](https://wordpress.org/support/users/zwalker/favorites/)

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce Stripe Payment Gateway] Rolled back to 9.0 from 9.1.1 – Fingerprint Token](https://wordpress.org/support/topic/rolled-back-to-9-0-from-9-1-1-fix-this-please/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rolled-back-to-9-0-from-9-1-1-fix-this-please/#post-18284719)
 * Cool, that’s another way to fix. We’re stuck on legacy for now because of some
   integrations with older plugins.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce Stripe Payment Gateway] Rolled back to 9.0 from 9.1.1 – Fingerprint Token](https://wordpress.org/support/topic/rolled-back-to-9-0-from-9-1-1-fix-this-please/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/rolled-back-to-9-0-from-9-1-1-fix-this-please/#post-18284711)
 * [@tremmert](https://wordpress.org/support/users/tremmert/) roll back to 9.0 and
   you should be good. If you look at the PR, they fixed it already but I’m super
   surprised they haven’t pushed this update yet. It should be a hot fix (not a 
   wait til the next major release). Kinda ridiculous.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/page/2/#post-15262439)
 * Thank you for adding the filter [@specialk](https://wordpress.org/support/users/specialk/).
   This is perfect.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/page/2/#post-15027065)
 * You’ll want to test this on your side but I added a check for this condition 
   in the function and works across the board for my use case.
 *     ```
       function theme_switcha_active_theme() {
       	global $theme_switcha_options;
   
       	$get_theme = wp_get_theme();
       	$options = $theme_switcha_options;
   
       	$active_theme = $get_theme->get('Name');
   
       	$pass_overload = ($options['allowed_users'] == "passkey" && !isset($_COOKIE['theme_switcha_passkey_'. COOKIEHASH]) && !is_admin())? FALSE: TRUE;
   
       	if (isset($_COOKIE['theme_switcha_theme_'. COOKIEHASH]) && $pass_overload) {
   
       		$active_theme = $_COOKIE['theme_switcha_theme_'. COOKIEHASH];
   
       	}
   
       	return $active_theme;
   
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/#post-15027002)
 * Awesome, thank you! I’ll see what I can do in the mean time.
 * Best,
    Zach
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/#post-15026932)
 * I am using the theme_switcha_active_theme() function from your plugin core file
   to see what the current switched too theme is and include anything relavant to
   that theme in my functions.php.
 * Right now, when logged out, this function is returning the switched too theme
   even if theme options / permissions don’t align.
 * Is there another function here that I can use to check the options?
 * if(function_exists(‘theme_switcha_active_theme’) && (theme_switcha_active_theme()
   == ‘my-switched-to-theme’)) {
    // DO important stuff } else { Do stuff for active
   theme }
    -  This reply was modified 4 years, 7 months ago by [zwalker](https://wordpress.org/support/users/zwalker/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/#post-15026874)
 * Ahh I see… it’s theme_switcha_active_theme() is returning the theme switched 
   theme on log out when passcode cookie is not set. I’m using this in my functions.
   php.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/#post-15026773)
 * Theme settings are passcode view only while logged out.
 * 1) Log in
    2) Theme Switch to anther theme which is not current one used on the
   site (this will set theme_switcha_theme_ cookie) 3) Log Out 4) See error. (Due
   to no pass cookie being set)
 * Happy to do a Loom if you’re unable to reproduce.
 * You can fix by adding a extra condition when it looks at what theme cookies are
   set. Have it default to current theme if no pass cookie is set and settings are
   passcode view only.
    -  This reply was modified 4 years, 7 months ago by [zwalker](https://wordpress.org/support/users/zwalker/).
    -  This reply was modified 4 years, 7 months ago by [zwalker](https://wordpress.org/support/users/zwalker/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/#post-15026720)
 * You’re aware of this error related to the use of the plugin though? It’s something
   that would make the most sense to fix from the plugin’s code base in the next
   update.
 * Something along these lines, maybe:
    <?php function theme_switcha_clear_cookies_on_logout(){
   unset($_COOKIE[‘theme_switcha_theme_’]); unset($_COOKIE[‘theme_switcha_pass_’]);}
   add_action( ‘wp_logout’, ‘theme_switcha_clear_cookies_on_logout’ ); ?>
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/#post-15026697)
 * Hi Jeff,
 * There was nothing of value in the debug / error logs and I couldn’t find a resolution
   so I ended up disabling WP Rocket and doing all the Caching / Optimisations programmatically
   instead.
 * I do get a critical error on the site if I use the top bar to switch themes and
   then log out. Can you hook the log out routine and clear your plugin cookies?
    -  This reply was modified 4 years, 7 months ago by [zwalker](https://wordpress.org/support/users/zwalker/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme Switcha - Easily Switch Themes for Development and Testing] Theme Switcher sets cookies then stays on current theme](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/)
 *  Thread Starter [zwalker](https://wordpress.org/support/users/zwalker/)
 * (@zwalker)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/theme-switcher-sets-cookies-then-stays-on-current-theme/#post-14913013)
 * Hi Jeff,
 * I figured it out. It’s a compatibility thing with the newest version of WP Rocket.
 * I disabled this plugin specifically and everything worked. Do you have any insight
   into why this might be happening?
 * I can exclude the theme-switcher cookies from the cache etc.
 * Best,
    Zach

Viewing 11 replies - 1 through 11 (of 11 total)