wp-bootstrap-navwalker
wp-bootstrap-navwalker copied to clipboard
display_element should call parent
Hello,
I think (in order to promote code reuse and avoid compatability issues) display_element should just make the check for children elements and then return control to the parent class. So something like (sorry, I was to lazy to make a pull request):
function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
if ( !$element )
return;
$id_field = $this->db_fields['id'];
//display this element
if ( is_object( $args[0] ) )
$args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
}
Thanks for the feedback, I will look into this.
Updated :)