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

    r38870 r41756  
    560560}
    561561add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
     562
     563
     564/**
     565 * Modifies tag cloud widget arguments to display all tags in the same font size
     566 * and use list format for better accessibility.
     567 *
     568 * @since Twenty Twelve 2.4
     569 *
     570 * @param array $args Arguments for tag cloud widget.
     571 * @return array The filtered arguments for tag cloud widget.
     572 */
     573function twentytwelve_widget_tag_cloud_args( $args ) {
     574    $args['largest']  = 22;
     575    $args['smallest'] = 8;
     576    $args['unit']     = 'pt';
     577    $args['format']   = 'list';
     578
     579    return $args;
     580}
     581add_filter( 'widget_tag_cloud_args', 'twentytwelve_widget_tag_cloud_args' );
Note: See TracChangeset for help on using the changeset viewer.