Walker::start_el( string $output, object $object, int $depth, array $args = array(), int $current_object_id )

Start the element output.


The $args parameter holds additional values that may be used with the child class methods. Includes the element output also.



(string) (Required) Used to append additional content (passed by reference).


(object) (Required) The data object.


(int) (Required) Depth of the item.


(array) (Optional) An array of additional arguments.

Default value: array()


(int) (Required) ID of the current item.

More Information

This method is abstract and should be explicitly defined in the child class, as needed. Also note that $output is passed by reference, so any changes made to the variable within the following methods are automatically handled (no return, echo, or print needed).

“Start Element”. Generally, this method is used to add the opening HTML tag for a single tree item (such as <li>, <span>, or <a>) to $output.


File: wp-includes/class-wp-walker.php

public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {}


Version Description
2.1.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.