Skip to content

Commit 30ff21f

Browse files
committed
Disable facets that aren't accessible
1 parent eb5d61f commit 30ff21f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

a11y-add-on-for-facetwp.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,28 @@
2020
* Load custom facet types
2121
*/
2222
function load_facets( $facet_types ) {
23+
// Load custom facets
2324
include( dirname( __FILE__ ) . '/facets/Submit.php' );
24-
2525
$facet_types['submit'] = new FacetWP_Facet_Submit();
2626

27+
// Remove facets that aren't yet accessible
28+
$disabled_facets = [
29+
'autocomplete', // Autocomplete dropdown is not focusable.
30+
'slider', // Using min + max setting is not accessible. Needs further review.
31+
'date_range', // Uses a date picker library that isn't accessible.
32+
'hierarchy', // Not keyboard or screen reader accessible.
33+
'rating', // Not keyboard or screen reader accessible.
34+
'fselect', // Not keyboard or screen reader accessible.
35+
'number_range', // Multiple inputs are not accessible.
36+
'proximity', // Missing labels, among other things.
37+
];
38+
39+
foreach( $disabled_facets as $facet ) {
40+
if( isset( $facet_types[ $facet ] ) ) {
41+
unset( $facet_types[ $facet ] );
42+
}
43+
}
44+
2745
return $facet_types;
2846
}
2947
add_filter( 'facetwp_facet_types', 'load_facets' );

0 commit comments

Comments
 (0)