- if ( is_array( $args[0] ) )
- $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
- $cb_args = array_merge( array(&$output, $element, $depth), $args);
- call_user_func_array(array(&$this, 'start_el'), $cb_args);
+ $this->has_children = ! empty( $children_elements[ $id ] );
+ if ( isset( $args[0] ) && is_array( $args[0] ) ) {
+ $args[0]['has_children'] = $this->has_children; // Backwards compatibility.
+ }