Title: Walker_Category::end_el
Published: April 25, 2014
Last modified: May 20, 2026

---

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

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#wp--skip-link--target)

Ends the element output, if needed.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#see-also)󠁿

 * [Walker::end_el()](https://developer.wordpress.org/reference/classes/Walker/end_el/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#parameters)󠁿

 `$output`stringrequired

Used to append additional content (passed by reference).

`$data_object`objectrequired

Category data object. Not used.

`$depth`intoptional

Depth of category. Not used.

`$args`arrayoptional

An array of arguments. Only uses `'list'` for whether should append to output. See
[wp_list_categories()](https://developer.wordpress.org/reference/functions/wp_list_categories/).

More Arguments from wp_list_categories( … $args )

Array or string of arguments. See [WP_Term_Query::__construct()](https://developer.wordpress.org/reference/classes/wp_term_query/__construct/)
for information on accepted arguments.

Default:`array()`

## 󠀁[Source](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#source)󠁿

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

    	$output .= "</li>\n";
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-walker-category.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-walker-category.php#L271)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-walker-category.php#L271-L277)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/walker_category/end_el/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Renamed `$page` to `$data_object` to match parent class for PHP 8 named parameter support. | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwalker_category%2Fend_el%2F)
before being able to contribute a note or feedback.