WooCommerce Code Reference

WC_Product_Cat_Dropdown_Walker extends Walker

Product category dropdown walker class.

Table of Contents

$db_fields  : array<string|int, mixed>
DB fields to use.
$tree_type  : string
What the class handles.
display_element()  : null
Traverse elements to create list from elements.
start_el()  : mixed
Starts the list before the elements are added.

Properties

Methods

display_element()

Traverse elements to create list from elements.

public display_element(object $element, array<string|int, mixed> &$children_elements, int $max_depth, int $depth, array<string|int, mixed> $args, string &$output) : null

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
$element : object

Data object.

$children_elements : array<string|int, mixed>

List of elements to continue traversing.

$max_depth : int

Max depth to traverse.

$depth : int

Depth of current element.

$args : array<string|int, mixed>

Arguments.

$output : string

Passed by reference. Used to append additional content.

Tags
since
2.5.0
Return values
nullNull on failure with no changes to parameters.

start_el()

Starts the list before the elements are added.

public start_el(string &$output, object $cat, int $depth[, array<string|int, mixed> $args = array() ], int $current_object_id) : mixed
Parameters
$output : string

Passed by reference. Used to append additional content.

$cat : object

Category.

$depth : int

Depth of category in reference to parents.

$args : array<string|int, mixed> = array()

Arguments.

$current_object_id : int

Current object ID.

Tags
see
Walker::start_el()
since
2.1.0
Return values
mixed