card_open() etc. * * @package Admbud */ if ( ! defined( 'ABSPATH' ) ) { exit; } // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Variables scoped to this included template file. use Admbud\Colours; use Admbud\Maintenance; /** @var \Admbud\Settings $settings */ $mode = admbud_get_option( 'admbud_maintenance_mode', 'off' ); $emergency_url = Maintenance::emergency_url(); // Coming Soon values $cs_title = admbud_get_option( 'admbud_coming_soon_title', __( 'Coming Soon', 'admin-buddy' ) ); $cs_message = admbud_get_option( 'admbud_coming_soon_message', __( "We're working on something exciting. Stay tuned!", 'admin-buddy' ) ); $cs_bg_type = admbud_get_option( 'admbud_cs_bg_type', 'gradient' ); $cs_bg_color = esc_attr( admbud_get_option( 'admbud_cs_bg_color', Colours::DEFAULT_PAGE_BG ) ); $cs_grad_from = esc_attr( admbud_get_option( 'admbud_cs_grad_from', Colours::DEFAULT_SIDEBAR_GRAD_FROM ) ); $cs_grad_to = esc_attr( admbud_get_option( 'admbud_cs_grad_to', Colours::DEFAULT_SIDEBAR_GRAD_TO ) ); $cs_grad_dir = admbud_get_option( 'admbud_cs_grad_direction', 'to bottom right' ); $cs_bg_image = esc_url( admbud_get_option( 'admbud_cs_bg_image_url', '' ) ); $cs_ov_color = esc_attr( admbud_get_option( 'admbud_cs_bg_overlay_color', '#000000' ) ); $cs_ov_op = absint( admbud_get_option( 'admbud_cs_bg_overlay_opacity', 30 ) ); // Maintenance values $maint_title = admbud_get_option( 'admbud_maintenance_title', __( 'Under Maintenance', 'admin-buddy' ) ); $maint_message = admbud_get_option( 'admbud_maintenance_message', __( "We're performing scheduled maintenance. We'll be back shortly!", 'admin-buddy' ) ); $maint_bg_type = admbud_get_option( 'admbud_maint_bg_type', 'gradient' ); $maint_bg_color = esc_attr( admbud_get_option( 'admbud_maint_bg_color', Colours::DEFAULT_PAGE_BG ) ); $maint_grad_from = esc_attr( admbud_get_option( 'admbud_maint_grad_from', Colours::DEFAULT_SIDEBAR_GRAD_FROM ) ); $maint_grad_to = esc_attr( admbud_get_option( 'admbud_maint_grad_to', Colours::DEFAULT_SIDEBAR_GRAD_TO ) ); $maint_grad_dir = admbud_get_option( 'admbud_maint_grad_direction', 'to bottom right' ); $maint_bg_image = esc_url( admbud_get_option( 'admbud_maint_bg_image_url', '' ) ); $maint_ov_color = esc_attr( admbud_get_option( 'admbud_maint_bg_overlay_color', '#000000' ) ); $maint_ov_op = absint( admbud_get_option( 'admbud_maint_bg_overlay_opacity', 30 ) ); // Text colours for intercept pages $cs_text_color = esc_attr( admbud_get_option( 'admbud_cs_text_color', Colours::DEFAULT_PAGE_TEXT ) ); $cs_message_color = esc_attr( admbud_get_option( 'admbud_cs_message_color', Colours::DEFAULT_PAGE_MESSAGE ) ); $maint_text_color = esc_attr( admbud_get_option( 'admbud_maint_text_color', Colours::DEFAULT_PAGE_TEXT ) ); $maint_message_color= esc_attr( admbud_get_option( 'admbud_maint_message_color',Colours::DEFAULT_PAGE_MESSAGE ) ); // Colours module OFF: page colours auto-follow the WP admin scheme. // The colour fields stay visible but inert, flagged with a notice. $colours_off = ! \Admbud\Settings::colours_module_active(); $directions = [ 'to top left' => '↖', 'to top' => '↑', 'to top right' => '↗', 'to left' => '←', 'to right' => '→', 'to bottom left' => '↙', 'to bottom' => '↓', 'to bottom right' => '↘', ]; $grid_order = [ 'to top left', 'to top', 'to top right', 'to left', null, 'to right', 'to bottom left', 'to bottom', 'to bottom right', ]; // Visibility helpers (PHP-rendered initial state; JS keeps them in sync instantly) $cs_hidden = $mode !== 'coming_soon' ? 'ab-hidden' : ''; $maint_hidden = $mode !== 'maintenance' ? 'ab-hidden' : ''; $off_hidden = $mode === 'off' ? 'ab-hidden' : ''; // bg-type sub-row visibility helpers $cs_hs = $cs_bg_type !== 'solid' ? 'ab-hidden' : ''; $cs_hg = $cs_bg_type !== 'gradient' ? 'ab-hidden' : ''; $cs_hi = $cs_bg_type !== 'image' ? 'ab-hidden' : ''; $maint_hs = $maint_bg_type !== 'solid' ? 'ab-hidden' : ''; $maint_hg = $maint_bg_type !== 'gradient' ? 'ab-hidden' : ''; $maint_hi = $maint_bg_type !== 'image' ? 'ab-hidden' : ''; $subtabs = [ 'mode-pages' => __( 'Mode & Pages', 'admin-buddy' ), 'emergency' => __( 'Bypass & Emergency URLs', 'admin-buddy' ) ]; $active = \Admbud\Settings::get_active_subtab( 'maintenance', 'mode' ); $active = in_array( $active, [ 'mode-pages', 'emergency' ], true ) ? $active : 'mode-pages'; ?>
$label ) : ?>

[ 'label' => __( 'Off', 'admin-buddy' ), 'svg' => '', 'desc' => __( 'Site is live and accessible to everyone.', 'admin-buddy' ) ], 'coming_soon' => [ 'label' => __( 'Coming Soon', 'admin-buddy' ), 'svg' => '', 'desc' => __( 'Pre-launch page. Returns 200 OK. Search engines can index it.', 'admin-buddy' ) ], 'maintenance' => [ 'label' => __( 'Maintenance', 'admin-buddy' ), 'svg' => '', 'desc' => __( 'Temporary outage. Returns 503 + Retry-After. Search engines will not deindex your site.', 'admin-buddy' ) ], ]; foreach ( $modes as $value => $opt ) : ?>

and /wp-admin/





 

render_page_preview( $prev_prefix, 'ab-maint-page-preview' ); endif; ?>