Opened 4 years ago
Closed 4 years ago
#9667 closed enhancement (fixed)
Misinformation in the inline code comment documentation for get_term_children
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.8 |
| Component: | Inline Docs | Version: | |
| Severity: | minor | Keywords: | has-patch |
| Cc: |
Description
The inline documentation around get_term_children suggests that it will take a term name, the function argument $term suggests it would take a Term object; neither is true, it takes a term ID and returns an array of term IDs.
I propose the attached patch which changes the function arg name to $term_id, and amends the inline documentation.
The only addition, potentially mildly contentious I suppose, is that the diff uses absint to ensure the term ID passed is definitely an integer.
Attachments (1)
Change History (7)
comment:1
simonwheatley — 4 years ago
- Keywords has-patch added
comment:3
simonwheatley — 4 years ago
Thanks for the suggestion filosofo, diff changed accordingly.
comment:4
jacobsantos — 4 years ago
- Component changed from Taxonomy to Inline Docs
- Owner ryan deleted
Note: See
TracTickets for help on using
tickets.

I think you should use intval instead of absint. Although term ids are not going to be negative in most cases (thanks to auto-increment), as far as I know nothing precludes them from being negative integers.