Skip to main content
full, tested version
Source Link
user47133
user47133

Try hooking on all these:

(But I guess you'd have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

/*
Plugin Name: test
Description: switchtest
Version: 0.1.0
*/

add_filter( 'template', 'yourthing_switch_theme' );
add_filter( 'option_template', 'yourthing_switch_theme' );
add_filter( 'option_stylesheet', 'yourthing_switch_theme' );
add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}

Try hooking on all these:

(But I guess you'd have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

add_filter( 'template', 'yourthing_switch_theme' );
add_filter( 'option_template', 'yourthing_switch_theme' );
add_filter( 'option_stylesheet', 'yourthing_switch_theme' );
add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}

Try hooking on all these:

(But I guess you'd have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

/*
Plugin Name: test
Description: switchtest
Version: 0.1.0
*/

add_filter( 'template', 'yourthing_switch_theme' );
add_filter( 'option_template', 'yourthing_switch_theme' );
add_filter( 'option_stylesheet', 'yourthing_switch_theme' );
add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}
added 174 characters in body
Source Link
user47133
user47133

You can hook onto pre_option_stylesheet.Try hooking on all these:

(But I guess you'd have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

add_filter( 'template', 'yourthing_switch_theme' );
add_filter( 'option_template', 'yourthing_switch_theme' );
add_filter( 'option_stylesheet', 'yourthing_switch_theme' );
add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}

You can hook onto pre_option_stylesheet.

(But I guess you'd have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}

Try hooking on all these:

(But I guess you'd have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

add_filter( 'template', 'yourthing_switch_theme' );
add_filter( 'option_template', 'yourthing_switch_theme' );
add_filter( 'option_stylesheet', 'yourthing_switch_theme' );
add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}
Source Link
user47133
user47133

You can hook onto pre_option_stylesheet.

(But I guess you'd have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}