function end_lvl(&$output, $depth = 0, $args = array()) { global $subnaviditeration; global $topnav_dropdown_desc_values; global $topnav_dropdown_desc_values_defaults; // If we are at a parent element, output this code to end the div.w-row (includes description and picture in dropdown) // This sprintf function can probably be used in the future to put in the correct description and image. if (0 == $depth) { ${$subnaviditeration} = settype($subnaviditeration, 'integer'); $text = $topnav_dropdown_desc_values[$subnaviditeration]['topnav_dropdown_desc_text'] ? $topnav_dropdown_desc_values[$subnaviditeration]['topnav_dropdown_desc_text'] : $topnav_dropdown_desc_values_defaults['topnav_dropdown_desc_text_default']; // if false $imgURL = $topnav_dropdown_desc_values[$subnaviditeration]['topnav_dropdown_desc_img']['url'] ? $topnav_dropdown_desc_values[$subnaviditeration]['topnav_dropdown_desc_img']['image_src']['medium'][0] : $topnav_dropdown_desc_values_defaults['topnav_dropdown_desc_img_default']['url']; $output .= sprintf("\n</ul>\n\t\t\t\n</div>\n\t\t\t\n<div class='w-col w-col-6 w-col-small-6'>\n\t\t\t\n<p class='dropdown-p'>%s</p>\n\t\t\t\n</div>\n\t\t\t\n<div class='w-col w-col-3 w-col-small-3'><img class='dropdown-img' src='%s'>\n\t\t\t\n</div>\n\t\t\t\n</div>", $text, $imgURL); } // Increments subnaviditeration so that the next button triggers the next w.row $subnaviditeration++; //I'm not sure what this does, but it was in the code I copied and I don't want to break it. :) parent::end_lvl($output, $depth, $args); }