db_fields['id'];
if ( is_object( $args[0] ) ) {
$args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
}
return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
}
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
if($depth == 0){
$out_div = '
';
}else{
$out_div = '';
}
// build html
$output .= "\n" . $indent . $out_div .'
' . "\n";
}
function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
if($depth == 0){
$out_div_close = '
';
}else{
$out_div_close = '';
}
$output .= "$indent". $out_div_close ."\n";
}
// add main/sub classes to li's and links
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$sub = "";
$indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent
if($depth==0 && $args->has_children) :
$sub = ' has_sub';
endif;
if( ( $depth==1 or $depth == 2 ) && $args->has_children) :
$sub = 'sub';
endif;
// passed classes
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );
//menu type class
$menu_type = "";
if($depth==0){
if($item->type_menu == "wide"){
$menu_type = " wide";
} else {
$menu_type = " narrow";
}
}
//wide menu position class
$wide_menu_position = "";
if($depth==0){
if($item->wide_position == "right"){
$wide_menu_position = " right_position";
}elseif($item->wide_position == "left"){
$wide_menu_position = " left_position";
}else{
$wide_menu_position = "";
}
}
$anchor = '';
if($item->anchor != ""){
$anchor = '#'.esc_attr($item->anchor);
$class_names .= ' anchor-item';
}
$active = "";
// depth dependent classes
if ($item->anchor == "" && (($item->current && $depth == 0) || ($item->current_item_ancestor && $depth == 0))):
$active = 'eltdf-active-item';
endif;
// build html
$output .= $indent . '