[wp-trac] [WordPress Trac] #40924: Making font_size data for wp_generate_tag_cloud_data filter more flexible

WordPress Trac noreply at wordpress.org
Wed Oct 18 01:04:47 UTC 2017


#40924: Making font_size data for wp_generate_tag_cloud_data filter more flexible
-----------------------------+-------------------------
 Reporter:  mhmdshv          |       Owner:
     Type:  feature request  |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Widgets          |     Version:  4.7.5
 Severity:  normal           |  Resolution:  maybelater
 Keywords:  2nd-opinion      |     Focuses:
-----------------------------+-------------------------
Changes (by welcher):

 * keywords:   => 2nd-opinion
 * status:  new => closed
 * resolution:   => maybelater
 * milestone:  Awaiting Review =>


Comment:

 @mhmdshv thanks for the reporting and welcome to WordPress core!

 It is currently possible to apply a filter to change the unit type using
 the `widget_tag_cloud_args` filter ( see the source below )
 {{{
 /**
  * Filters the taxonomy used in the Tag Cloud widget.
  *
  * @since 2.8.0
  * @since 3.0.0 Added taxonomy drop-down.
  * @since 4.9.0 Added the `$instance` parameter.
  *
  * @see wp_tag_cloud()
  *
  * @param array $args     Args used for the tag cloud widget.
  * @param array $instance Array of settings for the current widget.
  */

 $tag_cloud = wp_tag_cloud( apply_filters( 'widget_tag_cloud_args', array(
     'taxonomy'   => $current_taxonomy,
     'echo'       => false,
     'show_count' => $show_count,
 ), $instance ) );

 }}}

 You may be able to achieve what you're looking for by adding the filter
 above and setting `unit` as empty and then filtering the `font_size` to be
 `unset` using the `wp_generate_tag_cloud_data` filter.

 I'm going to close this out as a `maybelater` but @westonruter if you feel
 different, feel free to reopen.

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


More information about the wp-trac mailing list