Avoid a PHP notice when trying to access the `post_parent` property of hierarchical post type nav menu items.
FIxes #34446 git-svn-id: https://develop.svn.wordpress.org/trunk@35876 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4dfb95179a
commit
9c354378ff
|
@ -215,7 +215,7 @@ class Walker {
|
|||
$top_level_elements = array();
|
||||
$children_elements = array();
|
||||
foreach ( $elements as $e) {
|
||||
if ( 0 == $e->$parent_field )
|
||||
if ( empty( $e->$parent_field ) )
|
||||
$top_level_elements[] = $e;
|
||||
else
|
||||
$children_elements[ $e->$parent_field ][] = $e;
|
||||
|
|
Loading…
Reference in New Issue