wp-foundation icon indicating copy to clipboard operation
wp-foundation copied to clipboard

Declaration of foundation_navigation::start_lvl() should be compatible with Walker::start_lvl

Open Martinspire opened this issue 10 years ago • 1 comments

I've ben trying to customize the theme and updated the foundation to the latest, but i've now turned on wp debug and noticed this error:

SCREAM: Error suppression ignored for ( ! ) Strict standards: Declaration of foundation_navigation::start_lvl() should be compatible with Walker::start_lvl(&$output, $depth = 0, $args = Array) in \wp-content\themes\foundation\functions.php on line 202

It seems to be that this is the block of code:

/**

  • Navigation Menu Adjustments */

// Add class to navigation sub-menu class foundation_navigation extends Walker_Nav_Menu {

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

function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) { $id_field = $this->db_fields['id']; if ( !empty( $children_elements[ $element->$id_field ] ) ) { $element->classes[] = 'has-dropdown'; } Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); } }

Now i'm not really sure on how to fix this as i can't really see whats the problem. This is btw not a big issue as the site works normally but every debug warning is one to many in my book. So any info would be much abliged

Martinspire avatar Sep 11 '13 20:09 Martinspire

See this: http://wordpress.stackexchange.com/questions/95089/walker-nav-menu-exeption

The answer is changing the start_lvl of the foundation function to match the Walker Class:

function start_lvl( &$output, $depth = 0, $args = array() ){
}

tmort avatar Aug 26 '14 15:08 tmort