WC_Product_Cat_Dropdown_Walker::display_element( object $element, array $children_elements, int $max_depth, int $depth, array $args, string $output )
Traverse elements to create list from elements.
Description Description
Display one element if the element doesn’t have any children otherwise, display the element and its children. Will only traverse up to the max. depth and no ignore elements under that depth. It is possible to set the. max depth to include all depths, see walk() method.
This method shouldn’t be called directly, use the walk() method instead.
Parameters Parameters
- $element
-
(Required) Data object.
- $children_elements
-
(Required) List of elements to continue traversing.
- $max_depth
-
(Required) Max depth to traverse.
- $depth
-
(Required) Depth of current element.
- $args
-
(Required) Arguments.
- $output
-
(Required) Passed by reference. Used to append additional content.
Return Return
(null) Null on failure with no changes to parameters.
Source Source
File: includes/walkers/class-wc-product-cat-dropdown-walker.php
public function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
if ( ! $element || ( 0 === $element->count && ! empty( $args[0]['hide_empty'] ) ) ) {
return;
}
parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |