Wordpress menu check submenu
class MyWalker extends Walker_Nav_Menu
{
function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
{
$element->hasChildren = isset($children_elements[$element->ID]) && !empty($children_elements[$element->ID]);
$element->childrenCount = count( $children_elements[$element->ID] );
return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
}
function start_el(&$output, $item, $depth, $args)
{
global $wp_query;
// you know can access $item->hasChildren to do anything you want..
}
}