Description
We have filters that allow you to remove a specific Accessibility Checker rule or all rules of a type. This filter will stop the plugin from scanning for that particular issue and remove it from all reports.
Please note that all of our errors and warnings are specifically created to ensure that your website meets Website Content Accessibility Guidelines (WCAG) 2.1. Removing a warning or error rule is not advised; however, if you have a specific use case that warrants removing a rule or group of rules, you can do so with the code snippets below.
Usage
This is how the filter is added:
add_filter('edac_filter_register_rules','my_rule_filter');
The edac_filter_register_rules
filter allows you to define a different rule variable that removes rules individually or by type (error or warning) using the edac_remove_element_with_value()
function.
The edac_remove_element_with_value()
function accepts parameters for either a rule’s slug or type to remove that rule or all rules of the same type, such as:
edac_remove_element_with_value($rules, 'slug', 'slider_present');
Parameters
This table shows the slug and type for each rule in Accessibility Checker. These are the parameters that can be passed to the edac_remove_element_with_value()
function.
Title | Slug | Type |
---|---|---|
Ambiguous Anchor Text | link_ambiguous_text | error |
Blinking or Scrolling Content | text_blinking_scrolling | error |
Broken ARIA Reference | broken_aria_reference | error |
Broken Skip or Anchor Link | broken_skip_anchor_link | error |
Duplicate Form Label | duplicate_form_label | error |
Empty Button | empty_button | error |
Empty Form Label | empty_form_label | error |
Empty Heading Tag | empty_heading_tag | error |
Empty Link | empty_link | error |
Empty Table Header | empty_table_header | error |
Image Map Missing Alternative Text | image_map_missing_alt_text | error |
Image Missing Alternative Text | img_alt_missing | error |
Incorrect Heading Order | incorrect_heading_order | error |
Insufficient Color Contrast | color_contrast_failure | error |
Linked Image Empty Alternative Text | img_linked_alt_empty | error |
Linked Image Missing Alternative Text | img_linked_alt_missing | error |
Long Description Invalid | long_description_invalid | error |
Missing Form Label | missing_form_label | error |
Missing Language Declaration | missing_lang_attr | error |
Missing Table Header | missing_table_header | error |
Missing Title | missing_title | error |
Missing Transcript | missing_transcript | error |
iFrame Missing Title | iframe_missing_title | error |
A Slider is Present | slider_present | warning |
A Video is Present | video_present | warning |
ARIA hidden | aria_hidden | warning |
Duplicate Alternative Text | img_alt_redundant | warning |
Empty Paragraph Tag | paragraph_should_not_be_empty | warning |
Image Animated GIF | img_animated_gif | warning |
Image Empty Alternative Text | img_alt_empty | warning |
Image Long Alternative Text | img_alt_long | warning |
Link Opens New Window or Tab | link_blank | warning |
Link to MS Office File | link_ms_office_file | warning |
Link to Non-HTML File | link_non_html_file | warning |
Link to PDF | link_pdf | warning |
Low-quality Alternative Text | img_alt_invalid | warning |
Missing Subheadings | missing_headings | warning |
Possible Heading | possible_heading | warning |
Tab Order Modified | tab_order_modified | warning |
Text Justified | text_justified | warning |
Text Too Small | text_small | warning |
Underlined Text | underlined_text | warning |
Examples
Remove a single rule
Here is how to remove a specific rule, using the rule slug for the specific rule being removed. This example shows us removing the “Slider is Present” warning:
Remove all rules by type
Here is an example of how to remove all warning rules:
Since
This filter was added in Accessibility Checker 1.4.0.
Source Code
This filter is located in edac_register_rules() in /accessibility-checker.php