Walker_Comment::start_lvl() WordPress Method

The Walker_Comment::start_lvl() method is used to start the display of a new level of comments. This is typically called when a comment is replies to another comment.

Walker_Comment::start_lvl( string $output, int $depth, array $args = array() ) #

Starts the list before the elements are added.


Description

Top ↑

See also


Top ↑

Parameters

$output

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

$depth

(int)(Optional) Depth of the current comment. Default 0.

$args

(array)(Optional) Uses 'style' argument for type of HTML list.

Default value: array()


Top ↑

Source

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

	public function start_lvl( &$output, $depth = 0, $args = array() ) {
		$GLOBALS['comment_depth'] = $depth + 1;

		switch ( $args['style'] ) {
			case 'div':
				break;
			case 'ol':
				$output .= '<ol class="children">' . "\n";
				break;
			case 'ul':
			default:
				$output .= '<ul class="children">' . "\n";
				break;
		}
	}

Top ↑

Changelog

Changelog
VersionDescription
2.7.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.