On this page
Walker::start_el( string $output, object $data_object, int $depth, array $args = array(), int $current_object_id )
Starts the element output.
Description
The $args parameter holds additional values that may be used with the child class methods. Also includes the element output.
Parameters
$outputstring Required-
Used to append additional content (passed by reference).
$data_objectobject Required-
The data object.
$depthint Required-
Depth of the item.
$argsarray Optional-
An array of additional arguments.
Default:
array() $current_object_idint Optional-
ID of the current item. Default 0.
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.
Source
File: wp-includes/class-wp-walker.php. View all references
public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {}
Related
Used By
| Used By | Description |
|---|---|
| Walker::display_element() wp-includes/class-wp-walker.php | Traverses elements to create list from elements. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/Walker/start_el