wp-bootstrap-navwalker icon indicating copy to clipboard operation
wp-bootstrap-navwalker copied to clipboard

Warning/Errors upon upgrade to 3.6

Open imaginegrafix opened this issue 13 years ago • 8 comments

Getting the following messages after upgrading to 3.6:

Strict Standards: Declaration of wp_bootstrap_navwalker::start_lvl() should be compatible with Walker::start_lvl(&$output, $depth = 0, $args = Array) in wp_bootstrap_navwalker.php on line 143

Warning: Cannot modify header information - headers already sent by (output started at wp_bootstrap_navwalker.php:143) in wp-includes/option.php on line 571

Warning: Cannot modify header information - headers already sent by (output started at wp_bootstrap_navwalker.php:143) in wp-includes/option.php on line 572

imaginegrafix avatar Aug 07 '13 15:08 imaginegrafix

Removing this block of code seems to fix the issue and everything is functioning on the front end properly, just want to be sure it is safe to remove this:

function start_lvl( &$output, $depth ) {
        $indent = str_repeat( "\t", $depth );
        $output    .= "\n$indent<ul class=\"dropdown-menu\">\n";        
    }

imaginegrafix avatar Aug 07 '13 15:08 imaginegrafix

Interesting as I don't the that same error with 3.6, are you using version 1.4.3 of the walker?

Removing that block will make it so the menu can only have one level (no dropdowns)

SideQuestDIY avatar Aug 07 '13 15:08 SideQuestDIY

Yes, using the most current version and using with theme-hybrid - it does seem to be theme specific as if activate twentyten the error messages go away.

Am I losing anything vital by removing that code?

imaginegrafix avatar Aug 07 '13 15:08 imaginegrafix

You will lose the ability to use dropdown menus. As a point of curiosity can you share your wp_nav_menu() menu declaration block from your theme?

SideQuestDIY avatar Aug 07 '13 16:08 SideQuestDIY

Thanks for the quick reply - here is what I have:

<?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => 2, 'container' => 'nav', 'walker' => new wp_bootstrap_navwalker(), 'container_class' => 'nav-collapse', 'menu_class' => 'nav', 'menu_id' => 'menu-primary-items', 'fallback_cb' => 'wp_page_menu' ) ); ?>

imaginegrafix avatar Aug 07 '13 16:08 imaginegrafix

Hey @imaginegrafix sorry for the delay, I have been crazy busy. I don't get the same errors on 3.6 and haven't been able to replicate the issue. I merged @wboptimise's commit to add strict declarations, can you try the latest file and let me know if you still have an issue?

SideQuestDIY avatar Aug 15 '13 14:08 SideQuestDIY

Looks like it is all good now - thanks much; greatly appreciated!

imaginegrafix avatar Aug 15 '13 19:08 imaginegrafix

Awesome! Glad its working now :)

SideQuestDIY avatar Aug 15 '13 22:08 SideQuestDIY