WC_Product_Cat_Dropdown_Walker::display_element() public WC 2.5.0
Traverse elements to create list from elements.
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.
{} Это метод класса: WC_Product_Cat_Dropdown_Walker{}
Хуков нет.
Возвращает
null. Null on failure with no changes to parameters.
Использование
$WC_Product_Cat_Dropdown_Walker = new WC_Product_Cat_Dropdown_Walker(); $WC_Product_Cat_Dropdown_Walker->display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
- $element(объект) (обязательный) (передается по ссылке — &)
- Data object.
- $children_elements(массив) (обязательный) (передается по ссылке — &)
- List of elements to continue traversing.
- $max_depth(число) (обязательный) (передается по ссылке — &)
- Max depth to traverse.
- $depth(число) (обязательный) (передается по ссылке — &)
- Depth of current element.
- $args(массив) (обязательный) (передается по ссылке — &)
- Arguments.
- $output(строка) (обязательный) (передается по ссылке — &)
- Passed by reference. Used to append additional content.
Список изменений
С версии 2.5.0 | Введена. |
Код WC_Product_Cat_Dropdown_Walker::display_element() WC Product Cat Dropdown Walker::display element WC 5.0.0
public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
if ( ! $element || ( 0 === $element->count && ! empty( $args[0]['hide_empty'] ) ) ) {
return;
}
parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
}