Shortcode
[ariaccess_button] adds a button that opens the display panel, for example in a menu, footer or post. It has one attribute:
| Attribute | Default | What it does |
|---|---|---|
label | Display settings | The button text. |
[ariaccess_button label="Display settings"]
The button has the class ariaccess-open for styling. It works only on pages where the panel loads, so keep Show the display panel button on and at least one option on. To show only your own button, hide the floating button (#ariaccess .ariaccess-trigger) in your theme CSS.
Filters
| Filter | Parameters | What it filters |
|---|---|---|
ariaccess_capability | $cap (string) | Capability for the Fixes, Display panel, Statement and Settings tabs. Default manage_options. |
ariaccess_check_capability | $cap (string) | Capability for running checks and seeing reports. Default edit_others_posts. |
ariaccess_post_types | $types (string[]) | Post types the content check covers. |
ariaccess_rules | $rules (array, id => rule) | The content check rules. Each rule has title, wcag (string[]), type (error, warning or notice), why and fix. |
ariaccess_analyze | $issues (array), $xp (DOMXPath), $root (DOMElement) | Issues found in one post. $issues is rule id => [ 'count' => int, 'samples' => string[] ]. Add your own checks here; a rule id must exist in ariaccess_rules to be reported. |
ariaccess_theme_colors | $colors (array: text, background) | Colours assumed when content sets only one of them. Default from your theme's global styles, or #000000 and #ffffff. |
ariaccess_palette | $palette (array, slug => colour) | Theme palette colours used by the contrast check. |
ariaccess_toolbar_modules | $modules (array, key => [ label, type ]) | Display panel options and their labels. Only the 19 built-in keys can be switched on in settings. |
ariaccess_toolbar_active | $active (bool) | Whether the display panel loads on this request. |
ariaccess_admin_tabs | $tabs (array, slug => [ label, capability ]) | The admin tabs. Render a tab you add with the action ariaccess_admin_tab_{slug}. |
add_filter( 'ariaccess_post_types', function ( $types ) {
$types[] = 'product';
return $types;
} );
Actions
| Action | Parameters | When it fires |
|---|---|---|
ariaccess_loaded | None | AriAccess has loaded (on plugins_loaded). |
ariaccess_post_scanned | $post_id (int), $record (array) | A post has been checked. $record has time, version, issues and counts. |
ariaccess_page_scanned | $scan (array) | A page check result has been saved. $scan has url, title, time, standard, violations, incomplete and passes. |
ariaccess_admin_tab_{slug} | None | Renders a tab added through ariaccess_admin_tabs. |
REST route
POST /wp-json/ariaccess/v1/page-scan saves a page check result. The page check calls it from the browser; you do not normally need it. The user needs the check capability, and the request needs a wp_rest nonce.
| Parameter | Type | Required | What it is |
|---|---|---|---|
url | string | Yes | The checked page. Must be on this site. |
violations | array | No (default empty) | Each item: id, impact, help, helpUrl, nodes, wcag. Up to 100 are kept. |
title | string | No | Page title. |
incomplete | integer | No | Number of results that need a human check. |
passes | integer | No | Number of rules that passed. |
Stored data
| Name | Where | What it holds |
|---|---|---|
ariaccess_settings | Option | All settings. |
ariaccess_statement | Option | Statement form answers and the statement page ID. |
ariaccess_page_scans | Option | Page check results, the latest 200 pages. |
_ariaccess_scan | Post meta | Content check result for a post. |
_ariaccess_dismissed | Post meta | Dismissed rule IDs for a post. |
ariaccess_error_count | Transient | Number of problems shown on the admin menu. |
ariaccess | Visitor's browser (localStorage) | The visitor's display panel choices. |
With Delete all AriAccess data when the plugin is deleted ticked, deleting the plugin removes all of these from your database. The statement page and alt text stay.
Still stuck?
Our helpdesk answers on working days, Norwegian time. Include your WordPress version, PHP version and the page address.