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

    r37040 r41756  
    744744    return $images;
    745745}
     746
     747/**
     748 * Modifies tag cloud widget arguments to display all tags in the same font size
     749 * and use list format for better accessibility.
     750 *
     751 * @since Twenty Eleven 2.7
     752 *
     753 * @param array $args Arguments for tag cloud widget.
     754 * @return array The filtered arguments for tag cloud widget.
     755 */
     756function twentyeleven_widget_tag_cloud_args( $args ) {
     757    $args['largest']  = 22;
     758    $args['smallest'] = 8;
     759    $args['unit']     = 'pt';
     760    $args['format']   = 'list';
     761
     762    return $args;
     763}
     764add_filter( 'widget_tag_cloud_args', 'twentyeleven_widget_tag_cloud_args' );
Note: See TracChangeset for help on using the changeset viewer.