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/twentythirteen/functions.php

    r38870 r41756  
    616616}
    617617add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );
     618
     619/**
     620 * Modifies tag cloud widget arguments to display all tags in the same font size
     621 * and use list format for better accessibility.
     622 *
     623 * @since Twenty Thirteen 2.3
     624 *
     625 * @param array $args Arguments for tag cloud widget.
     626 * @return array The filtered arguments for tag cloud widget.
     627 */
     628function twentythirteen_widget_tag_cloud_args( $args ) {
     629    $args['largest']  = 22;
     630    $args['smallest'] = 8;
     631    $args['unit']     = 'pt';
     632    $args['format']   = 'list';
     633
     634    return $args;
     635}
     636add_filter( 'widget_tag_cloud_args', 'twentythirteen_widget_tag_cloud_args' );
Note: See TracChangeset for help on using the changeset viewer.