WC_Product_Cat_Dropdown_Walker::display_element()publicWC 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).

Использование

$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(int) (обязательный)
Max depth to traverse.
$depth(int) (обязательный)
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 8.7.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 );
}