From 9c354378ff76b512fa1e8f0e771bdd0b6ef323be Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 12 Dec 2015 01:05:27 +0000 Subject: [PATCH] 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 --- src/wp-includes/class-wp-walker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-walker.php b/src/wp-includes/class-wp-walker.php index e4890ae5c6..ee68a205e9 100644 --- a/src/wp-includes/class-wp-walker.php +++ b/src/wp-includes/class-wp-walker.php @@ -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;