Make WordPress Core


Ignore:
Timestamp:
10/03/2017 12:16:31 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Twenty Seventeen: 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 sami.keijonen.
Fixes #40184.

File:
1 edited

Legend:

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

    r41342 r41703  
    543543
    544544/**
     545 * Modify tag cloud widget arguments to display all tags in the same font size
     546 * and use list format for better accessibility.
     547 *
     548 * @since Twenty Seventeen 1.4
     549 *
     550 * @param array $args Arguments for tag cloud widget.
     551 * @return array The filtered arguments for tag cloud widget.
     552 */
     553function twentyseventeen_widget_tag_cloud_args( $args ) {
     554    $args['largest']  = 1;
     555    $args['smallest'] = 1;
     556    $args['unit']     = 'em';
     557    $args['format']   = 'list';
     558    return $args;
     559}
     560add_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' );
     561
     562/**
    545563 * Implement the Custom Header feature.
    546564 */
Note: See TracChangeset for help on using the changeset viewer.