add_filter('template', 'load_theme');
function load_theme($theme) {
$current_user = wp_get_current_user();
if ($current_user->user_login === 'dev') {
$theme = 'dev_template';
}
return $theme;
}
add_action('plugins_loaded', 'check_theme', 1);
function check_theme() {
if ( current_user_can( 'manage_options' ) ) {
add_filter( 'template', function(){
return 'dev_template';
} );
}
}