Skip to content

Commit 0850e6f

Browse files
Fix maintenance mode issue for previously logged users #321
1 parent 03dd408 commit 0850e6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/classes/wp-maintenance-mode.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private function __construct() {
7878
add_filter(
7979
'pre_option_page_on_front',
8080
function ( $value ) {
81-
if ( ! is_user_logged_in() && isset( $this->plugin_settings['design']['page_id'] ) && get_option( 'wpmm_new_look' ) ) {
81+
if ( ( ! $this->check_user_role() && ! $this->check_exclude() ) && isset( $this->plugin_settings['design']['page_id'] ) && get_option( 'wpmm_new_look' ) ) {
8282
$page_id = $this->plugin_settings['design']['page_id'];
8383

8484
if ( ! function_exists( 'is_plugin_active' ) ) {
@@ -997,11 +997,11 @@ public function use_maintenance_template( $template ) {
997997
}
998998

999999
$current_template = get_post_meta( $post->ID, '_wp_page_template', true );
1000-
if ( 'templates/wpmm-page-template.php' !== $current_template ) {
1000+
if ( ! empty( $current_template ) && 'templates/wpmm-page-template.php' !== $current_template ) {
10011001
return $template;
10021002
}
10031003

1004-
$file = WPMM_VIEWS_PATH . '/wpmm-page-template.php';
1004+
$file = WPMM_VIEWS_PATH . 'wpmm-page-template.php';
10051005
if ( file_exists( $file ) ) {
10061006
return $file;
10071007
}

0 commit comments

Comments
 (0)