Reply To: Error messages above header area

Home Forums Support Error messages above header area Reply To: Error messages above header area

Home Forums Support Error messages above header area Reply To: Error messages above header area

#198301
Tom
Lead Developer
Lead Developer

Was just doing some testing on the free version.

This is the function in GP it’s clashing with:

add_filter( 'walker_nav_menu_start_el', 'generate_nav_dropdown', 10, 4 );
function generate_nav_dropdown( $item_output, $item, $depth, $args ) 
{
	// If we're working with the primary or secondary theme locations
	if ( 'primary' == $args->theme_location || 'secondary' == $args->theme_location || 'slideout' == $args->theme_location ) {
		// If a dropdown menu is detected
		$dropdown = ( in_array( 'menu-item-has-children', $item->classes ) ) ? true : false;
		if ( $dropdown ) :
			// Add our arrow icon
			$item_output = str_replace( $args->link_after . '</a>', $args->link_after . '<span role="button" class="dropdown-menu-toggle" aria-expanded="false"></span></a>', $item_output );
		endif;
	}
	
	// Return the output
	return $item_output;
}

Basically, the error is saying $item->classes isn’t an array, which it is by default in WordPress.

I wonder if something in the plugin is causing it not to be an array? Worth asking them.