get_slug() ] = [ 'label' => esc_html__( 'Add Label To Links That Open A New Tab/Window', 'accessibility-checker' ), 'type' => 'checkbox', 'labelledby' => 'add_new_window_warning', 'description' => sprintf( // translators: %1%s: A tag containing target="_blank". esc_html__( 'Add a label and icon to links with %1$s informing users they will open a new tab/window. %2$sNote: This setting will have no effect if the "Block Links Opening New Windows" fix is enabled.%3$s', 'accessibility-checker' ), 'target="_blank"', '
', '' ), 'fix_slug' => $this->get_slug(), 'group_name' => $this->get_nicename(), 'help_id' => 9946, ]; return $fields; } /** * Run the fix for adding the comment and search form labels. */ public function run(): void { if ( ! get_option( 'edac_fix_' . $this->get_slug(), false ) ) { return; } // unregister the anww script if it's present, this fix supercedes it. if ( class_exists( '\ANWW' ) && defined( 'ANWW_VERSION' ) ) { add_action( 'wp_enqueue_scripts', function () { wp_deregister_script( 'anww' ); wp_deregister_style( 'anww' ); }, PHP_INT_MAX ); } add_filter( 'edac_filter_frontend_fixes_data', function ( $data ) { $data[ $this->get_slug() ] = [ 'enabled' => true, 'classPrefix' => 'edac-nww', 'localizedString' => __( 'opens a new window', 'accessibility-checker' ), ]; return $data; } ); add_action( 'wp_head', [ $this, 'add_styles' ] ); } /** * Add the styles for the new window warning. */ public function add_styles() { $font_url = EDAC_PLUGIN_URL . 'assets/fonts'; ?>