Skip to content

Commit 8ba1bd0

Browse files
committed
pagination: remove label, add nav and screenreader h2
1 parent 121f8f5 commit 8ba1bd0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

a11y-add-on-for-facetwp.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ function a11y_addon_transform_facet_markup( $output, $params ) {
140140

141141
break;
142142

143+
case 'pager':
144+
145+
$wrapper = '<nav class="navigation pagination" aria-label="Pagination"><h2 class="screen-reader-text">Pagination</h2>';
146+
147+
$output = sprintf('
148+
<nav class="navigation pagination" aria-label="Pagination"><h2 class="screen-reader-text">Pagination</h2>%1$s</nav>',
149+
$output);
150+
143151
default:
144152

145153
$id_string = 'id="'.$params['facet']['name'].'" class=';
@@ -212,7 +220,7 @@ function remove_underscores( name ) {
212220

213221
if ( facet_name && facet_type ) {
214222
// Don't label some facets
215-
if ( facet_type.match(/checkboxes|radio|pagination|reset|results_count/g) ) {
223+
if ( facet_type.match(/checkboxes|radio|pager|reset|results_count/g) ) {
216224
return;
217225
}
218226

0 commit comments

Comments
 (0)