Skip to content
Commit a3747463 authored by Scott Taylor's avatar Scott Taylor
Browse files

In `get_terms()`, don't set automatically `hierarchical` to `false` when...

In `get_terms()`, don't set automatically `hierarchical` to `false` when `parent => 0` is passed. The default value for `parent` is `''`.

In `_get_term_children()`, don't skip a top-level term without first including its children in the returned term list. Ironically, the call to `_get_term_children()` in `get_terms()` has a comment stating `"Make sure we show empty categories that have children."`, but it didn't work if you were retrieving top-level categories only.

All unit tests pass. Added a unit test based on the use case described in this ticket.

Fixes #26903.


Built from https://develop.svn.wordpress.org/trunk@27108


git-svn-id: https://core.svn.wordpress.org/trunk@26975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent fc8f6557
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment