twittem/wp-bootstrap-navwalker — pull request #129 by bucaran (2014-08-20 06:57:14+00:00)
Title: Updated class to use WP filters instead.

## Background
I am currently working in a Jade + PHP + Bootstrap framework and bumped into applying dropdown menus to Wordpress. After poking around and swallowing frustration I stumbled upon your class, but I couldn't quite wrap my head around it, so I began a 2 ½ day sleep deprivation struggle trying to make sense out of WP's filter / plugin framework and the `Walker` and `Walker_Nav_Menu` classes.

### Changes Summary
+ Updated `start_lvl` to rely on the parent's implementation. This added one extra line but reduced the complexity of dealing with the internal indentation implementation details.
+ `start_el ` was removed as we can rely on WP's `nav_menu_css_class`, `nav_menu_link_attributes` and `walker_nav_menu_start_el` filters to accomplish the same.
+ `display_element` was slightly updated to be arguably readable creating a `$this->has_children` property used throughout the filters via `$args->walker` as well.
+ Filters to customize the `$class_names`, `$atts` and final `$output` were added to reduce code duplication and simplify the process.

### Notes on Wordpress 4.0
WP 4.0 adds a new `protected $has_children;` property to `Walker_Nav_Menu`, effectively sparing us from hacking `display_element`.

### Rationale
After noticing your class was mostly duplicating `Walker_Nav_Menu` and adding the relevant parts to enable dropdown menus I edited out the redundancy and implemented my own solution via one function using filters and a trivial subclass of `Walker_Nav_Menu`. Actually, if there was a filter to customize the start of a level in the tree, we wouldn't even need to override `start_lvl` at all.

### tl;dr
It is more robust to rely on Wordpress' filter/hook framework than to subclass `Walker_Nav_Menu`. This avoids code duplication and arguably increases readability.