WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#7504 closed defect (bug) (fixed)

wp_tag_cloud does not honor largest and smallest options

Reported by: Edoardo Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.6
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

<?php wp_tag_cloud('format=list&smallest=10&largest=10'); ?>

When you have an unevenly distributed amount of tags (quite the ordinary situation) that template tag does not produce an equal font sized list as expected.

Attachments (1)

7504.diff (512 bytes) - added by scohoust 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 @scohoust7 years ago

It looks like there is always meant to be at least 1 unit a difference between the largest and smallest. The attached seems to fix it, whether it is indeed a bug. Alternatively, you could change the unit to be something where a difference of 1 isn't noticeable.

@scohoust7 years ago

comment:2 @westi7 years ago

  • Keywords has-patch added
  • Milestone changed from 2.6.1 to 2.6.2

2.6.1 has been released, moving to 2.6.2 milestone

comment:3 follow-up: @Edoardo7 years ago

The patch provided does indeed fix the issue however I think that the line following the changed one must be changed too in order to set $font_spread to 0 (not 1) if the $font_spread is negative.

comment:4 in reply to: ↑ 3 @scohoust7 years ago

Replying to Edoardo:

The patch provided does indeed fix the issue however I think that the line following the changed one must be changed too in order to set $font_spread to 0 (not 1) if the $font_spread is negative.

That would work, although $font_spread only becomes negative when someone sets the smallest font greater than the larger font, hopefully pretty rare.

comment:5 @jacobsantos6 years ago

  • Keywords commit added

comment:6 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9952]) Honor largest and smallest options when they are the same. Props scohoust. fixes #7504

Note: See TracTickets for help on using tickets.