﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
14040,Prevent empty class attribute in start_el of the Walker_Nav_Menu walker class,jaapjanfrans,,"If you filter the classes of a menu item by adding a filter to the hook 'nav_menu_css_class' and your filter function returns an empty array then a 'class=' string is still added to the output of the element.

I would like the function to check if the $classes string is empty or not and decide to add 'class=' + $classes only if $classes is not empty.

Current code:
{{{
$classes = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
		$classes = ' class=""' . esc_attr( $classes ) . '""';
}}}

possible solution:
{{{
$classes = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
		if(!empty($classes))
		{
			$classes = ' class=""' . esc_attr( $classes ) . '""';
		}
		else
		{
			$classes = '';
		}
}}}

",enhancement,closed,normal,,Themes,3.0,minor,invalid,"walker, start_el, class attribute",
