get_slug() ] = [ 'title' => esc_html__( 'Label Form Fields', 'accessibility-checker' ), 'callback' => [ $this, $this->get_slug() . '_section_callback' ], ]; return $sections; } ); add_filter( 'edac_filter_fixes_settings_fields', [ $this, 'get_fields_array' ], ); } /** * Get the settings fields for the fix. * * @param array $fields The array of fields that are already registered, if any. * * @return array */ public function get_fields_array( array $fields = [] ): array { $fields[ 'edac_fix_' . $this->get_slug() ] = [ 'label' => esc_html__( 'Label Form Fields', 'accessibility-checker' ), 'type' => 'checkbox', 'labelledby' => $this->get_slug(), 'description' => esc_html__( 'Add labels to unlabelled form fields if field purpose can be determined.', 'accessibility-checker' ), 'section' => $this->get_slug(), 'upsell' => isset( $this->is_pro ) && $this->is_pro ? false : true, 'group_name' => $this->get_nicename(), 'fancy_name' => $this->get_fancyname(), 'fix_slug' => $this->get_slug(), 'help_id' => 8497, ]; return $fields; } /** * Run the fix for adding the comment and search form labels. */ public function run(): void { // Intentionally left empty. } /** * Callback for the fix settings section. * * @return void */ public function add_label_to_unlabelled_form_fields_section_callback() { ?>

tag. esc_html__( 'Attempt to add labels to form fields that are missing them. Note: You may need to add custom styles targeting the %1$s class if adding labels affects your form layouts.', 'accessibility-checker' ), '.edac-generated-label' ); ?>