Walker_Comment::ping() WordPress Method

The Walker_Comment::ping() method is used to display a list of comments that have been posted on a particular post. This method is used by the WordPress comment system to display the comments on a post.

Walker_Comment::ping( WP_Comment $comment, int $depth, array $args ) #

Outputs a pingback comment.


Description

Top ↑

See also


Top ↑

Parameters

$comment

(WP_Comment)(Required)The comment object.

$depth

(int)(Required)Depth of the current comment.

$args

(array)(Required)An array of arguments.


Top ↑

Source

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

	protected function ping( $comment, $depth, $args ) {
		$tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
		?>
		<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( '', $comment ); ?>>
			<div class="comment-body">
				<?php _e( 'Pingback:' ); ?> <?php comment_author_link( $comment ); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
			</div>
		<?php
	}


Top ↑

Changelog

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