Make WordPress Core


Ignore:
Timestamp:
09/12/2022 11:32:57 PM (4 years ago)
Author:
audrasjb
Message:

Editor: Hide query loop pagination link arrows from assistive technology.

This changeset adss an aria-hidden="true" attribute to the optional arrows/chevron characters to the Query Loop and to the Comments Query Loop blocks pagination links.

These characters are text, so they're read out by assistive technologies. For better accessibility, it's best to reduce noise for screen reader users and prevent them to be rendered, using the aria-hidden="true" attribute.

Follow-up to [52057].

Props afercia, sabernhardt, kamig478, zieladam, audrasjb, joedolson, costdev.
Fixes #56067.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r54132 r54138  
    12571257                $arrow           = $arrow_map[ $block->context['paginationArrow'] ][ $pagination_type ];
    12581258                $arrow_classes   = "wp-block-query-pagination-$pagination_type-arrow is-arrow-$arrow_attribute";
    1259                 return "<span class='$arrow_classes'>$arrow</span>";
     1259                return "<span class='$arrow_classes' aria-hidden='true'>$arrow</span>";
    12601260        }
    12611261        return null;
     
    14061406                $arrow           = $arrow_map[ $block->context['comments/paginationArrow'] ][ $pagination_type ];
    14071407                $arrow_classes   = "wp-block-comments-pagination-$pagination_type-arrow is-arrow-$arrow_attribute";
    1408                 return "<span class='$arrow_classes'>$arrow</span>";
     1408                return "<span class='$arrow_classes' aria-hidden='true'>$arrow</span>";
    14091409        }
    14101410        return null;
Note: See TracChangeset for help on using the changeset viewer.