Last active
August 29, 2015 13:59
-
-
Save grok/10508187 to your computer and use it in GitHub Desktop.
Encountering what appears to be a core bug with the core WordPress Walker_Nav_Menu being extended within PHP 5.4.24 WordPress V3.8.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class My_Walker extends Walker_Nav_Menu { | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo '##### COMMENSE MY WALKER #####' . "\n"; | |
wp_nav_menu( | |
array( | |
'walker' => new My_Walker() | |
) | |
); | |
echo '##### COMPLETE MY WALKER #####'; | |
echo "\n\n"; | |
echo '##### COMMENSE CORE WALKER #####' . "\n"; | |
wp_nav_menu(); | |
echo '##### COMPLETE CORE WALKER #####'; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### COMMENSE MY WALKER ##### | |
<br /> | |
<b>Notice</b>: Trying to get property of non-object in <b>/wp-includes/nav-menu-template.php</b> on line <b>148</b><br /> | |
<br /> | |
<b>Notice</b>: Trying to get property of non-object in <b>/wp-includes/nav-menu-template.php</b> on line <b>151</b><br /> | |
<br /> | |
<b>Notice</b>: Trying to get property of non-object in <b>/wp-includes/nav-menu-template.php</b> on line <b>151</b><br /> | |
<br /> | |
<b>Notice</b>: Trying to get property of non-object in <b>/wp-includes/nav-menu-template.php</b> on line <b>153</b><br /> | |
<div class="menu"><ul><li id="menu-item-2" class="menu-item-2"><a></a></li></ul></div> | |
##### COMPLETE MY WALKER ##### | |
##### COMMENSE CORE WALKER ##### | |
<div class="menu"><ul><li class="page_item page-item-2"><a href="/?page_id=2">Sample Page</a></li></ul></div> | |
##### COMPLETE CORE WALKER ##### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@JoshKoberstein are you speaking towards AFTER you have created a menu entry and have >= 1 menu item in it?
This problem only manifests if you write the code and no menu exists in the system as far as I can tell.
P.S. I'm including @ notation with your name so that when they get that working it should display properly :)