mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Avoid infinite recursion in get_term_children() when a term is incorrectly a parent of itself.
props kovshenin. fixes #27123. Built from https://develop.svn.wordpress.org/trunk@27837 git-svn-id: http://core.svn.wordpress.org/trunk@27671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
88e3ebe05b
commit
6ca804ee76
@ -1107,6 +1107,10 @@ function get_term_children( $term_id, $taxonomy ) {
|
||||
$children = $terms[$term_id];
|
||||
|
||||
foreach ( (array) $terms[$term_id] as $child ) {
|
||||
if ( $term_id == $child ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset($terms[$child]) )
|
||||
$children = array_merge($children, get_term_children($child, $taxonomy));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user