Ensure a 'has_children' parameter is given to start_el
|Reported by:||jaapjanfrans||Owned by:|
In the current display_element function of the Walker class, a 'has_children' argument is only added if args is an array.
I'm not quite sure why this is the case. Wouldn't it be easier if a has_children argument is always added and passed on on to the callback functions like start_el?
i've currently modified a custom walker to do it like this:
//display this element if ( is_array( $args ) ) $args['has_children'] = ! empty( $children_elements[$element->$id_field] ); $cb_args = array_merge( array(&$output, $element, $depth), $args); $cb_args['has_children'] = ! empty( $children_elements[$element->$id_field] );
But recon it can be done in a cleaner way.
Change History (11)
- Keywords reporter-feedback added; has children walker has_children removed
- Keywords reporter-feedback removed
- Milestone Unassigned deleted
- Resolution set to invalid
- Status changed from new to closed
comment:4 in reply to: ↑ 3 jaapjanfrans — 4 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
- Component changed from General to Template
- Milestone set to 3.1