Created
March 22, 2019 18:55
Pretend another theme is active in the WP dashboard to maintain access to everything when something in your theme messes everything up (or whatevs).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'template', 'onx_change_theme' ); | |
add_filter( 'option_template', 'onx_change_theme' ); | |
add_filter( 'option_stylesheet', 'onx_change_theme' ); | |
add_filter( 'pre_option_stylesheet', 'onx_change_theme' ); | |
function onx_change_theme( $theme ) | |
{ | |
if ( is_admin() && ( function_exists( 'wp_get_current_user' ) ) ) | |
{ | |
if ( current_user_can( 'administrator' ) ) | |
return 'twentynineteen'; | |
} | |
return $theme; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment