WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#41585 closed enhancement (fixed)

Wrong parameter type for term_id in get_term_children

Reported by: wido Owned by: SergeyBiryukov
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch
Focuses: docs Cc:

Description

The parameter $term_id must be an int value for get_term_children() but the doc say string.

Internally the variable is converted to an int using the function intval that is correct since we cannot take advantage of php7 scalar type declaration but the correct value to pass to the function must be an integer not a string.

Attachments (1)

41585.patch (501 bytes) - added by Soean 3 years ago.
Changes $term_id @param docs from string to int

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
3 years ago

  • Component changed from General to Taxonomy
  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 4.9

@Soean
3 years ago

Changes $term_id @param docs from string to int

#2 @Soean
3 years ago

  • Keywords has-patch added; needs-patch good-first-bug removed

#3 @SergeyBiryukov
3 years ago

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

In 41235:

Docs: Correct @param type for $term_id in get_term_children().

Props Soean, wido.
Fixes #41585.

Note: See TracTickets for help on using tickets.