Walker_Comment::end_el()publicWP 2.7.0

Ends the element output, if needed.

{} It's a method of the class: Walker_Comment{}

No Hooks.

Return

null. Nothing.

Usage

$Walker_Comment = new Walker_Comment();
$Walker_Comment->end_el( $output, $data_object, $depth, $args );
$output(string) (required) (passed by reference — &)
Used to append additional content. Passed by reference.
$data_object(WP_Comment) (required)
Comment data object.
$depth(int)
Depth of the current comment.
$args(array)
An array of arguments.
Default: empty array

Notes

Changelog

Since 2.7.0 Introduced.
Since 5.9.0 Renamed $comment to $data_object to match parent class for PHP 8 named parameter support.

Code of Walker_Comment::end_el() WP 6.0

public function end_el( &$output, $data_object, $depth = 0, $args = array() ) {
	if ( ! empty( $args['end-callback'] ) ) {
		ob_start();
		call_user_func(
			$args['end-callback'],
			$data_object, // The current comment object.
			$args,
			$depth
		);
		$output .= ob_get_clean();
		return;
	}
	if ( 'div' === $args['style'] ) {
		$output .= "</div><!-- #comment-## -->\n";
	} else {
		$output .= "</li><!-- #comment-## -->\n";
	}
}