Make WordPress Core

Changeset 59113


Ignore:
Timestamp:
09/28/2024 11:34:28 PM (2 weeks ago)
Author:
joedolson
Message:

Accessibility: Clarify aria-label in pagination links.

Change posts and comments pagination nav regions to have an aria-label of "Posts pagination" and "Comments pagination", respectively. This provides improved context for the numeric links contained within these regions and differentiates between posts navigation regions and posts pagination regions.

Props michaelbourne, sabernhardt, afercia, xyulex, webmandesign, tirth03, joedolson.
Fixes #54260.

File:
1 edited

Legend:

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

    r59081 r59113  
    29322932 *
    29332933 *     @type string $screen_reader_text Screen reader text for navigation element.
    2934  *                                      Default 'Posts navigation'.
    2935  *     @type string $aria_label         ARIA label text for the nav element. Default 'Posts'.
     2934 *                                      Default 'Posts pagination'.
     2935 *     @type string $aria_label         ARIA label text for the nav element. Default 'Posts pagination'.
    29362936 *     @type string $class              Custom class for the nav element. Default 'pagination'.
    29372937 * }
     
    29562956                'prev_text'          => _x( 'Previous', 'previous set of posts' ),
    29572957                'next_text'          => _x( 'Next', 'next set of posts' ),
    2958                 'screen_reader_text' => __( 'Posts navigation' ),
    2959                 'aria_label'         => __( 'Posts' ),
     2958                'screen_reader_text' => __( 'Posts pagination' ),
     2959                'aria_label'         => __( 'Posts pagination' ),
    29602960                'class'              => 'pagination',
    29612961            )
     
    33683368 *     Optional. Default pagination arguments.
    33693369 *
    3370  *     @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'.
    3371  *     @type string $aria_label         ARIA label text for the nav element. Default 'Comments'.
     3370 *     @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments pagination'.
     3371 *     @type string $aria_label         ARIA label text for the nav element. Default 'Comments pagination'.
    33723372 *     @type string $class              Custom class for the nav element. Default 'comments-pagination'.
    33733373 * }
     
    33853385        $args,
    33863386        array(
    3387             'screen_reader_text' => __( 'Comments navigation' ),
    3388             'aria_label'         => __( 'Comments' ),
     3387            'screen_reader_text' => __( 'Comments pagination' ),
     3388            'aria_label'         => __( 'Comments pagination' ),
    33893389            'class'              => 'comments-pagination',
    33903390        )
Note: See TracChangeset for help on using the changeset viewer.