Walker::end_lvl() WordPress Method

The Walker::end_lvl() method is called when the end of a level in the menu is reached. This method is used to add the closing markup for each level, such as the closing tag.

Walker::end_lvl( string $output, int $depth, array $args = array() ) #

Ends the list of after the elements are added.


Description

The $args parameter holds additional values that may be used with the child class methods. This method finishes the list at the end of output of the elements.


Top ↑

Parameters

$output

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

$depth

(int)(Required)Depth of the item.

$args

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

Default value: array()


Top ↑

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).

This method “End Level” is run when the walker reaches the end of a “branch” in the tree structure. Generally, this method is used to add the closing tag of a container HTML element (such as </ol>, </ul>, or </div>) to $output.


Top ↑

Source

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

	public function end_lvl( &$output, $depth = 0, $args = array() ) {}


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.