Based on answers like this oneanswers like this one, I made a small plugin to display a theme displaying a "Coming soon" theme, whilst our team of editors can fill in the final theme.
It worked yesterday, but today, even though I'm logged in, I only see the "waiting" theme.
I logged out and logged back in, but still, I'm seeing the "waiting" theme, as if the is_user_logged_in()
function returned false. Are these hooks too early to check for user authentification?
<?php
add_filter('template', 'pxln_change_theme');
add_filter('stylesheet', 'pxln_change_theme');
function pxln_change_theme($theme) {
if ( ! is_user_logged_in() ) {
$theme = 'waiting';
}
return $theme;
}