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

    r38870 r41756  
    387387
    388388/**
     389 * Modifies tag cloud widget arguments to display all tags in the same font size
     390 * and use list format for better accessibility.
     391 *
     392 * @since Twenty Fifteen 1.9
     393 *
     394 * @param array $args Arguments for tag cloud widget.
     395 * @return array The filtered arguments for tag cloud widget.
     396 */
     397function twentyfifteen_widget_tag_cloud_args( $args ) {
     398    $args['largest']  = 22;
     399    $args['smallest'] = 8;
     400    $args['unit']     = 'pt';
     401    $args['format']   = 'list';
     402
     403    return $args;
     404}
     405add_filter( 'widget_tag_cloud_args', 'twentyfifteen_widget_tag_cloud_args' );
     406
     407
     408/**
    389409 * Implement the Custom Header feature.
    390410 *
Note: See TracChangeset for help on using the changeset viewer.