Opened 15 months ago
Closed 13 months ago
#20072 closed defect (bug) (fixed)
get_the_tag_list should accept same arguments as get_the_category_list
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | General | Version: | 3.3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | ben@… |
Description
It is bad form that the get_the_tag_list() relies on global variables to retrive tag information about a post. What if you want tag information about a post OTHER than the current post? The get_the_category_list() function is nearly identical in purpose, yet it does not suffer from this same restriction.
Compare the arguments here:
http://codex.wordpress.org/Function_Reference/get_the_tag_list
To here:
http://codex.wordpress.org/Function_Reference/get_the_category_list
I would expect these functions to have nearly identical inputs. If I am manually iterating over a list of post IDs (i.e. not in the loop), then it's a challenge to get the tag information here.
Attachments (2)
Change History (7)
20072.2.diff also removes the default value for the $id parameter on some of the term functions. This parameter isn't optional as it's followed by the non-optional $taxonomy. Also fixes a notice when passing $id = 0 to get_the_terms() and global $post isn't an object.
Also see #17558 for $id = 0 stuff.

Add $id param