Account for two dots elements to add aria-label to page link

This commit is contained in:
Gabriel Manussakis 2024-09-14 17:11:17 -03:00
parent a07ae75477
commit b63aae0987
1 changed files with 3 additions and 4 deletions

View File

@ -4161,11 +4161,10 @@ function wc_add_aria_label_to_pagination_numbers( $html, $args ) {
}
if ( $p->has_class( 'dots' ) ) {
// If current page is before the dots.
if ( $args['current'] + $args['mid_size'] < $args['total'] - $args['end_size'] ) {
$n = $args['total'] - $args['end_size'];
} else {
if ( $args['current'] - $args['mid_size'] > $n ) {
$n = $args['current'] - $args['mid_size'] - 1;
} else {
$n = $args['total'] - $args['end_size'];
}
++$n;
continue;