Skip to content

Commit 0f53631

Browse files
committed
better logic for labels and legends
1 parent 6216818 commit 0f53631

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

a11y-add-on-for-facetwp.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ function a11y_addon_transform_facet_markup( $output, $params ) {
117117

118118
$output = str_replace('class=', $id_string, $output);
119119

120+
break;
121+
120122
case 'radio':
121123
$output = sprintf('<fieldset><legend>%1$s</legend>',
122124
$params['facet']['label'] );
@@ -204,12 +206,8 @@ function remove_underscores( name ) {
204206
var facet_type = $facet.attr('data-type');
205207

206208
if ( facet_name && facet_type ) {
207-
// Don't label the pagination or reset XXX clean this up
208-
if ( facet_type.match(/checkboxes/g) ||
209-
facet_type.match(/radio/g)
210-
facet_name.match(/pagination/g) ||
211-
facet_name.match(/reset/g) ||
212-
facet_name.match(/results_count/g) ) {
209+
// Don't label some facets
210+
if ( facet_type.match(/checkboxes|radio|pagination|reset|results_count/g) ) {
213211
return;
214212
}
215213

0 commit comments

Comments
 (0)