Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#17558 closed defect (bug) (fixed)

Incorrect docs in get_the_terms().

Reported by: mfields Owned by: ryan
Milestone: 3.2 Priority: normal
Severity: normal Version: 3.2
Component: Inline Docs Keywords: has-patch commit
Focuses: Cc:


I've recently used get the terms outside the loop successfully, but the docs state that it must be used inside the loop both in the Codex an inline. I believe this to be an error. Please correct me if I am wrong.

Attachments (1)

17558.get-the-terms-docs.diff (440 bytes) - added by mfields 7 years ago.
Remove potentially incorrect documentation.

Download all attachments as: .zip

Change History (6)

7 years ago

Remove potentially incorrect documentation.

#1 @nacin
7 years ago

  • Keywords commit added; dev-feedback removed
  • Milestone changed from Awaiting Review to 3.2

It's accurate only when the $id is not passed (or rather, is 0/false/null, since the next argument is required) and you're outside the loop. This change is fine to me.

#2 @mfields
7 years ago

Should docs be updated to reflect this? I'll upload another path if so.

#3 @ryan
7 years ago

These functions are odd in that $id has a default but is followed by a non-optional taxonomy. The default should likely be removed. I don't know that we should bother documenting passing 0. Might as well just past the ID since you have to pass something.

#4 @ryan
7 years ago

#15160 added a default. It seems we should do the opposite and remove these defaults since taxonomy is not optional.

#5 @ryan
7 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [18081]:

Remove misleading phpdoc. Props mfields. fixes #17558

Note: See TracTickets for help on using tickets.