$default ) { if ( is_int( $default ) ) { $output[ $key ] = isset( $input[ $key ] ) ? 1 : 0; } elseif ( strpos( $key, 'color' ) !== false ) { $output[ $key ] = isset( $input[ $key ] ) ? sanitize_hex_color( $input[ $key ] ) : $default; } else { $output[ $key ] = isset( $input[ $key ] ) ? sanitize_text_field( $input[ $key ] ) : $default; } } return $output; } add_action( 'admin_enqueue_scripts', 'wpas_admin_assets' ); function wpas_admin_assets( $hook ) { if ( 'settings_page_wp-a11ykit-accessibility' !== $hook ) return; wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); wp_add_inline_style( 'wp-color-picker', wpas_admin_inline_css() ); wp_add_inline_script( 'wp-color-picker', 'jQuery(function($){ $(".wpas-color-picker").wpColorPicker(); });' ); } function wpas_admin_inline_css() { return ' .wpas-admin-wrap { max-width:900px; } .wpas-tabs { display:flex; gap:0; border-bottom:2px solid #0073aa; margin-bottom:20px; flex-wrap:wrap; } .wpas-tab-btn { background:#f1f1f1; border:1px solid #ccc; border-bottom:none; padding:8px 18px; cursor:pointer; font-size:13px; transition:background .2s; } .wpas-tab-btn.active, .wpas-tab-btn:hover { background:#fff; color:#0073aa; font-weight:600; } .wpas-tab-panel { display:none; } .wpas-tab-panel.active { display:block; } .wpas-section { background:#fff; border:1px solid #e5e5e5; border-radius:4px; margin-bottom:20px; padding:20px; } .wpas-section h3 { margin-top:0; border-bottom:1px solid #eee; padding-bottom:10px; } .wpas-field { display:flex; align-items:flex-start; gap:12px; margin-bottom:14px; } .wpas-field label { min-width:260px; font-weight:500; } .wpas-field input[type=text], .wpas-field input[type=number], .wpas-field select { width:220px; } .wpas-field .wpas-toggle{min-width:0px;} .wpas-toggle { position:relative; display:inline-block; width:44px; height:24px; } .wpas-toggle input { opacity:0; width:0; height:0; } .wpas-slider { position:absolute; inset:0; background:#ccc; border-radius:24px; cursor:pointer; transition:.3s; } .wpas-slider:before { content:""; position:absolute; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; } .wpas-toggle input:checked + .wpas-slider { background:#0073aa; } .wpas-toggle input:checked + .wpas-slider:before { transform:translateX(20px); } .wpas-badge { display:inline-block; background:#0073aa; color:#fff; border-radius:10px; font-size:11px; padding:1px 8px; margin-left:6px; } '; } function wpas_render_admin_page() { if ( ! current_user_can( 'manage_options' ) ) return; $s = wpas_get_settings(); ?>

v

__( '🛠 Toolbar', 'a11ykit-accessibility' ), 'skip' => __( '⏭ Skip Links', 'a11ykit-accessibility' ), 'focus' => __( '🔲 Focus', 'a11ykit-accessibility' ), 'font' => __( '🔤 Font Size', 'a11ykit-accessibility' ), 'contrast' => __( '🎨 Contrast', 'a11ykit-accessibility' ), 'links' => __( '🔗 Links', 'a11ykit-accessibility' ), 'images' => __( '🖼 Images', 'a11ykit-accessibility' ), 'keyboard' => __( '⌨ Keyboard', 'a11ykit-accessibility' ), 'aria' => __( '♿ ARIA', 'a11ykit-accessibility' ), 'motion' => __( '💫 Motion', 'a11ykit-accessibility' ), 'advanced' => __( '⚙ Advanced', 'a11ykit-accessibility' ), ); $first = true; foreach ( $tabs as $id => $label ) { $active = $first ? ' active' : ''; echo ''; $first = false; } ?>

__( 'Bottom Right', 'a11ykit-accessibility' ), 'bottom-left' => __( 'Bottom Left', 'a11ykit-accessibility' ), 'top-right' => __( 'Top Right', 'a11ykit-accessibility' ), 'top-left' => __( 'Top Left', 'a11ykit-accessibility' ), ) ); ?>

__( 'Default (hidden until focused)', 'a11ykit-accessibility' ), 'always' => __( 'Always visible', 'a11ykit-accessibility' ), ) ); ?>

'Solid', 'dashed' => 'Dashed', 'dotted' => 'Dotted', 'double' => 'Double', ) ); ?>

'; echo ''; echo ''; echo ''; } function wpas_text_field( $key, $label, $s ) { $val = isset( $s[ $key ] ) ? esc_attr( $s[ $key ] ) : ''; echo '
'; echo ''; echo ''; echo '
'; } function wpas_number_field( $key, $label, $s, $min = 0, $max = 999 ) { $val = isset( $s[ $key ] ) ? intval( $s[ $key ] ) : 0; echo '
'; echo ''; echo ''; echo '
'; } function wpas_color_field( $key, $label, $s ) { $val = isset( $s[ $key ] ) ? esc_attr( $s[ $key ] ) : '#000000'; echo '
'; echo ''; echo ''; echo '
'; } function wpas_select_field( $key, $label, $s, $options ) { $val = isset( $s[ $key ] ) ? $s[ $key ] : ''; echo '
'; echo ''; echo ''; echo '
'; } /* ── PRO Upsell admin notice ──────────────────────────────────────────────── */ add_action( 'admin_notices', 'wpas_pro_upsell_notice' ); function wpas_pro_upsell_notice() { $screen = get_current_screen(); if ( ! $screen || $screen->id !== 'settings_page_wp-a11ykit-accessibility' ) return; echo '
'; echo '
🚀 Upgrade to A11yKit Accessibility PRO
Unlock AI alt text generator, WCAG audit reports, 7 disability profiles, voice navigation, WooCommerce support, white-label & more.
'; echo 'Get PRO →'; echo '
'; }