Ticket #5726 (closed enhancement: fixed)

Opened 7 months ago

Last modified 7 months ago

Random order argument/Hook in wp_tag_cloud()

Reported by: fitztrev Assigned to: anonymous
Priority: normal Milestone: 2.5
Component: General Version:
Severity: normal Keywords: has-patch
Cc:

Description

wp_tag_cloud currently accepts 2 'order' arguments: DESC & ASC.

This patch adds 'RAND' capabilities to randomize the order of the tag cloud or list.

Can prevent large font face tags from being next to each other when the user doesn't necessarily want to sort the tags alphabetically.

Usage:

<?php wp_tag_cloud('order=RAND'); ?>

Attachments

rand.diff (498 bytes) - added by fitztrev on 01/28/08 05:54:43.
hook1.diff (476 bytes) - added by fitztrev on 01/28/08 19:37:47.
wp_tag_counts hook

Change History

01/28/08 05:54:43 changed by fitztrev

  • attachment rand.diff added.

01/28/08 06:02:12 changed by fitztrev

  • keywords set to has-patch.

01/28/08 19:37:21 changed by fitztrev

  • summary changed from Random order argument in wp_tag_cloud() to Random order argument/Hook in wp_tag_cloud().

Another option is to make it pluggable. As it stands now, there is no way to hook into the $counts array between the time it is created and when the html is processed. This may have more uses beyond just reordering the array.

Patch provided.

01/28/08 19:37:47 changed by fitztrev

  • attachment hook1.diff added.

wp_tag_counts hook

02/13/08 19:12:46 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6824]) Add RAND order option to wp_tag_cloud(). Props fitzrev. fixes #5726