get_settings(); $exclude = AccessKit_Sanitize::parse_exclude( $settings['exclude_pages'] ); if ( ! empty( $exclude['ids'] ) || ! empty( $exclude['slugs'] ) ) { $obj = get_queried_object(); if ( $obj instanceof WP_Post ) { if ( in_array( $obj->ID, $exclude['ids'], true ) ) { return false; } if ( in_array( $obj->post_name, $exclude['slugs'], true ) ) { return false; } } } return true; } /** * Lazy settings loader. * * @return array */ private function get_settings() { if ( empty( $this->settings ) ) { $this->settings = AccessKit_Defaults::settings(); } return $this->settings; } /** * Enqueue CSS + JS. */ public function enqueue() { if ( ! $this->should_render() ) { return; } wp_enqueue_style( 'accesskit-widget', ACCESSKIT_PLUGIN_URL . 'assets/css/widget.css', array(), ACCESSKIT_VERSION ); wp_enqueue_script( 'accesskit-widget', ACCESSKIT_PLUGIN_URL . 'assets/js/widget.js', array(), ACCESSKIT_VERSION, true ); wp_add_inline_style( 'accesskit-widget', $this->build_inline_css() ); } /** * Build inline CSS for brand customisation. * * @return string */ private function build_inline_css() { $s = $this->get_settings(); $css = ':root{'; $css .= '--a11y-navy:' . $s['brand_color'] . ';'; $css .= '--a11y-active:' . $s['brand_color'] . ';'; $css .= '--a11y-bg:' . $s['bg_color'] . ';'; $css .= '--a11y-reset-bg:' . $s['reset_bg'] . ';'; $css .= '}'; if ( 'right' === $s['position'] ) { $css .= '.a11y-widget{left:auto !important;right:20px !important;}'; $css .= '.a11y-widget__panel{left:auto !important;right:0 !important;}'; } if ( ! empty( $s['custom_css'] ) ) { $css .= "\n" . $s['custom_css']; } return $css; } /** * Render the widget markup in wp_footer. */ public function render() { if ( ! $this->should_render() ) { return; } $s = $this->get_settings(); $features = AccessKit_Defaults::features(); $title_text = $s['title_text']; $enabled = array(); foreach ( $features as $key => $label ) { if ( ! empty( $s[ $key ] ) ) { $enabled[ $key ] = $label; } } $this->print_widget( $title_text, $enabled ); } /** * Print the full widget markup. * * @param string $title_text Plain (un-escaped) launcher title. * @param array $enabled Map of feature_key => translated label. */ private function print_widget( $title_text, $enabled ) { ?> TT'; } private function svg_font_down() { return ''; } private function svg_spacing() { return ''; } private function svg_line() { return ''; } private function svg_dyslexia() { return ''; } private function svg_adhd() { return ''; } private function svg_saturation() { return ''; } private function svg_invert() { return ''; } private function svg_links() { return ''; } private function svg_tts() { return ''; } private function svg_cursor() { return ''; } private function svg_pause() { return ''; } private function svg_no_images() { return ''; } }