Skip to content

Commit

Permalink
release: version 2.6.7
Browse files Browse the repository at this point in the history
- Bug fix: Addressed an unnecessary 'no maintenance page' error occurrence.
  • Loading branch information
arinaturcu authored Apr 1, 2023
2 parents e7269a4 + 4304975 commit b2655e1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions includes/classes/wp-maintenance-mode-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1023,12 +1023,15 @@ public function add_notices() {
}
}

// check if the maintenance.php template is overridden
$overrideable_template = wpmm_get_template_path( 'maintenance.php', true );
if ( WPMM_VIEWS_PATH . 'maintenance.php' === $overrideable_template && ( isset( $this->plugin_settings['design']['page_id'] ) || ! isset( $this->plugin_settings['design']['page_id'] ) || ! get_post( $this->plugin_settings['design']['page_id'] ) ) ) {
$notices['maintenance_page_not_found'] = array(
'class' => 'error',
'msg' => sprintf( __( '<strong>Action required</strong>: you don\'t have a page as Maintenance page. Visit <a href="%s">settings page</a> to select one.', 'wp-maintenance-mode' ), get_admin_url() . 'options-general.php?page=wp-maintenance-mode#design' ),
);
if ( WPMM_VIEWS_PATH . 'maintenance.php' === $overrideable_template ) {
if ( ! isset( $this->plugin_settings['design']['page_id'] ) || ! get_post( $this->plugin_settings['design']['page_id'] ) ) {
$notices['maintenance_page_not_found'] = array(
'class' => 'error',
'msg' => sprintf( __( '<strong>Action required</strong>: you don\'t have a page as Maintenance page. Visit <a href="%s">settings page</a> to select one.', 'wp-maintenance-mode' ), get_admin_url() . 'options-general.php?page=wp-maintenance-mode#design' ),
);
}
}
}

Expand Down

0 comments on commit b2655e1

Please sign in to comment.