Walker_Page::end_el() WordPress Method

The Walker_Page::end_el() method is used to end the element output for a page. This is typically used to close the element's tags and add any closing markup, such as a closing

tag.

Walker_Page::end_el( string $output, WP_Post $data_object, int $depth, array $args = array() ) #

Outputs the end of the current element in the tree.


Description

Top ↑

See also


Top ↑

Parameters

$output

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

$data_object

(WP_Post)(Required)Page data object. Not used.

$depth

(int)(Optional) Depth of page. Default 0 (unused).

$args

(array)(Optional) Array of arguments.

Default value: array()


Top ↑

Source

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

	public function end_el( &$output, $data_object, $depth = 0, $args = array() ) {
		if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
			$t = "\t";
			$n = "\n";
		} else {
			$t = '';
			$n = '';
		}
		$output .= "</li>{$n}";
	}

Top ↑

Changelog

Changelog
VersionDescription
5.9.0Renamed $page to $data_object to match parent class for PHP 8 named parameter support.
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.