Opened 13 years ago
Closed 13 years ago
#15313 closed enhancement (fixed)
Allow wp_tag_cloud() to accept an array of taxonomies
Reported by: |
|
Owned by: |
|
---|---|---|---|
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)
Change History (11)
#1
@
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
#2
@
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
@
13 years ago
Your patch makes sense, but it doesn't match with the description.
When is $tag->taxonomy ever an array?
#4
@
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.
#7
@
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 );
#8
@
13 years ago
The suggested change will allow tag clouds of several taxonomies.
It was inspired by: http://wordpress.stackexchange.com/questions/3540/how-do-i-display-a-tag-cloud-with-both-post-tags-and-a-custom-taxonomy/3541#3541
Note: See
TracTickets for help on using
tickets.
Added patch