[wp-trac] [WordPress Trac] #35566: Remove title attributes: Tag cloud widget uses title to display topic count

WordPress Trac noreply at wordpress.org
Tue Mar 14 07:11:03 UTC 2017


#35566: Remove title attributes: Tag cloud widget uses title to display topic count
---------------------------------------+--------------------------------
 Reporter:  adamsoucie                 |       Owner:  afercia
     Type:  defect (bug)               |      Status:  assigned
 Priority:  normal                     |   Milestone:  4.8
Component:  Widgets                    |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  has-patch has-screenshots  |     Focuses:  ui, accessibility
---------------------------------------+--------------------------------

Comment (by sami.keijonen):

 I tested the latest patch and I like the approach.

 > and based on the fact the smallest and largest arguments are the same,
 the aria-label attribute is not printed out, Twenty Seventeen instead just
 overrides the inline styles with an !important set on the font-size
 declaration thus making impossible to implement the same logic.

 @afercia: I'm trying to read this but don't fully understand it and I'm
 not sure is Twenty16 or Twenty17 doing it right:).

 I take Twenty16 as an example. Are you suggesting that we add
 `$args['format'] = 'list'` like this:


 {{{
 function twentysixteen_widget_tag_cloud_args( $args ) {
         $args['largest']  = 1;
         $args['smallest'] = 1;
         $args['unit']     = 'em';
         $args['format']   = 'list';
         return $args;
 }
 add_filter( 'widget_tag_cloud_args', 'twentysixteen_widget_tag_cloud_args'
 );
 }}}

 And then small tweaks to CSS like this:

 {{{
 /* Tag Cloud widget */
 .tagcloud ul {
         list-style: none;
         margin: 0;
 }

 .tagcloud li {
         display: inline-block;
 }

 .tagcloud a {
         border: 1px solid #d1d1d1;
         border-radius: 2px;
         display: block;
         font-family: Montserrat, "Helvetica Neue", sans-serif;
         line-height: 1;
         padding: 0.5625em 0.4375em 0.5em;
         margin: 0 0.1875em 0.4375em 0;
 }
 }}}

 That does print out `aria-label="alignment (3 items)"` for example.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35566#comment:34>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list