Walker_Comment::end_el()publicWP 2.7.0

Ends the element output, if needed.

Метод класса: Walker_Comment{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Walker_Comment = new Walker_Comment();
$Walker_Comment->end_el( $output, $data_object, $depth, $args );
$output(строка) (обязательный) (передается по ссылке — &)
Used to append additional content. Passed by reference.
$data_object(WP_Comment) (обязательный)
Comment data object.
$depth(int)
Depth of the current comment.
$args(массив)
An array of arguments.
По умолчанию: empty array

Заметки

Список изменений

С версии 2.7.0 Введена.
С версии 5.9.0 Renamed $comment to $data_object to match parent class for PHP 8 named parameter support.

Код Walker_Comment::end_el() WP 6.5.2

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";
	}
}