Walker_Category::end_el() WordPress Method

The Walker_Category::end_el() method is used to end the element for a category in a WordPress category list. This is a method of the Walker_Category class, which is used to create category lists in WordPress.

Walker_Category::end_el( string $output, object $data_object, int $depth, array $args = array() ) #

Ends the element output, if needed.


Description

Top ↑

See also


Top ↑

Parameters

$output

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

$data_object

(object)(Required)Category data object. Not used.

$depth

(int)(Optional) Depth of category. Not used.

$args

(array)(Optional) An array of arguments. Only uses 'list' for whether should append to output. See wp_list_categories().

Default value: array()


Top ↑

Source

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

	public function end_el( &$output, $data_object, $depth = 0, $args = array() ) {
		if ( 'list' !== $args['style'] ) {
			return;
		}

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