#27487 closed defect (bug) (fixed)
Clarify the return value of wp_generate_tag_cloud()
| Reported by: | SergeyBiryukov | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | Taxonomy | Version: | 2.7 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | docs |
Description (last modified by )
Background: #27413
The function description says that it only returns a string:
tags/3.8.1/src/wp-includes/category-template.php#L604
However, it can also return an array, depending on format argument:
tags/3.8.1/src/wp-includes/category-template.php#L680
It also returns null if $tags argument is empty:
tags/3.8.1/src/wp-includes/category-template.php#L626
I think it should only return a string or an array, for consistency with the format argument.
Attachments (3)
Change History (10)
#2
@
12 years ago
27487.2.patch changes the variable to $output.
#3
@
12 years ago
Works for me.
27487.3.patch fixes the hook docs to account for the mixed type on $output.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The verbiage of
return $returnis not my favorite, even though it's already in use at the end of the function. Would be nice if it were something like$outputinstead.That said, I agree about returning only a string or array.