wp-bootstrap-navwalker icon indicating copy to clipboard operation
wp-bootstrap-navwalker copied to clipboard

display_element should call parent

Open sebakerckhof opened this issue 13 years ago • 2 comments

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);
    }

sebakerckhof avatar Jun 13 '13 13:06 sebakerckhof

Thanks for the feedback, I will look into this.

SideQuestDIY avatar Jun 17 '13 18:06 SideQuestDIY

Updated :)

SideQuestDIY avatar Jul 10 '13 22:07 SideQuestDIY