Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2021
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2. add_hook('ClientAreaPage', 1, function($vars) {
  3.    
  4.     if($vars['filename'] === 'clientarea'){ // If you want it on the register page, use 'register' instead
  5.         $currentTheme = $_SESSION['Template']; // Store the current theme
  6.         $_SESSION['Template'] = 'twenty-one'; // Update theme to twenty-one for the specific page
  7.         if($currentTheme !== 'twenty-one'){
  8.             header('Location: '.$_SERVER['REQUEST_URI']); // Reload the page
  9.         }
  10.     }else{
  11.         $currentTheme = $_SESSION['Template']; // Do the same stuff as above, just for every other page and set the theme back to the normal one
  12.         $_SESSION['Template'] = 'six';
  13.         if($currentTheme !== 'six'){
  14.             header('Location: '.$_SERVER['REQUEST_URI']);
  15.         }
  16.     }
  17. });
  18.  
  19. [Click and drag to move]
  20.  
  21.  
  22. ​
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement