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

    r40022 r41756  
    528528add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 );
    529529
     530
     531/**
     532 * Modifies tag cloud widget arguments to display all tags in the same font size
     533 * and use list format for better accessibility.
     534 *
     535 * @since Twenty Fourteen 2.1
     536 *
     537 * @param array $args Arguments for tag cloud widget.
     538 * @return array The filtered arguments for tag cloud widget.
     539 */
     540function twentyfourteen_widget_tag_cloud_args( $args ) {
     541    $args['largest']  = 22;
     542    $args['smallest'] = 8;
     543    $args['unit']     = 'pt';
     544    $args['format']   = 'list';
     545
     546    return $args;
     547}
     548add_filter( 'widget_tag_cloud_args', 'twentyfourteen_widget_tag_cloud_args' );
     549
     550
    530551// Implement Custom Header features.
    531552require get_template_directory() . '/inc/custom-header.php';
Note: See TracChangeset for help on using the changeset viewer.