Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#15313 closed enhancement (fixed)

Allow wp_tag_cloud() to accept an array of taxonomies

Reported by: sorich87's profile sorich87 Owned by: sorich87's profile sorich87
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

Allow wp_tag_cloud() to accept an array of arguments.

Attachments (1)

15313.diff (640 bytes) - added by sorich87 13 years ago.

Download all attachments as: .zip

Change History (11)

@sorich87
13 years ago

#1 @sorich87
13 years ago

  • Cc sorich87@… added
  • Keywords has-patch added
  • Owner set to sorich87
  • Status changed from new to accepted
  • Version set to 3.1

Added patch

#2 @sorich87
13 years ago

  • Summary changed from Allow wp_tag_cloud() to accept an array of arguments to Allow wp_tag_cloud() to accept an array of taxonomies

#3 @scribu
13 years ago

Your patch makes sense, but it doesn't match with the description.

When is $tag->taxonomy ever an array?

#4 @sorich87
13 years ago

It is actually assumed that $args['taxonomy'] is always a string. So, it is passed to get_term_link() which only accept a string as second argument.

When $args['taxonomy'] is not a string but an array, we get an error.

Replacing $args['taxonomy'] by $tag->taxonomy fixes the issue.

#5 @scribu
13 years ago

Could you provide some steps to reproduce the error?

#6 @scribu
13 years ago

  • Keywords reporter-feedback added

#7 @sorich87
13 years ago

  • Keywords reporter-feedback removed

The following code will produce the error:

$args = array(
    'taxonomy' => array( 'category', 'post_tag' )
);
wp_tag_cloud( $args );

#9 @scribu
13 years ago

  • Milestone changed from Awaiting Review to 3.1

#10 @scribu
13 years ago

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

(In [16180]) Allow tag cloud using multiple taxonomies. Props sorich87. Fixes #15313

Note: See TracTickets for help on using tickets.