WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/04/2017 11:52:03 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Bundled Themes: Change tag cloud format to a list (<ul>) for better semantics and accessibility.

List markup allows screen reader users to know in advance how many tags are within the list.

Props xkon, davidakennedy.
Fixes #40138.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentysixteen/functions.php

    r41580 r41756  
    416416
    417417/**
    418  * Modifies tag cloud widget arguments to have all tags in the widget same font size.
     418 * Modifies tag cloud widget arguments to display all tags in the same font size
     419 * and use list format for better accessibility.
    419420 *
    420421 * @since Twenty Sixteen 1.1
    421422 *
    422423 * @param array $args Arguments for tag cloud widget.
    423  * @return array A new modified arguments.
     424 * @return array The filtered arguments for tag cloud widget.
    424425 */
    425426function twentysixteen_widget_tag_cloud_args( $args ) {
    426     $args['largest'] = 1;
     427    $args['largest']  = 1;
    427428    $args['smallest'] = 1;
    428     $args['unit'] = 'em';
     429    $args['unit']     = 'em';
     430    $args['format']   = 'list';
     431
    429432    return $args;
    430433}
Note: See TracChangeset for help on using the changeset viewer.