WP_Comments_List_Table::single_row() WordPress Method

The WP_Comments_List_Table::single_row() method is used to display a single row of data for a comment in the comments list table. This method is called by the WP_Comments_List_Table::display() method for each comment in the list.

WP_Comments_List_Table::single_row( WP_Comment $item ) #


Parameters

$item

(WP_Comment)(Required)


Top ↑

Source

File: wp-admin/includes/class-wp-comments-list-table.php

	public function single_row( $item ) {
		global $post, $comment;

		$comment = $item;

		$the_comment_class = wp_get_comment_status( $comment );

		if ( ! $the_comment_class ) {
			$the_comment_class = '';
		}

		$the_comment_class = implode( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) );

		if ( $comment->comment_post_ID > 0 ) {
			$post = get_post( $comment->comment_post_ID );
		}

		$this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );

		echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
		$this->single_row_columns( $comment );
		echo "</tr>\n";

		unset( $GLOBALS['post'], $GLOBALS['comment'] );
	}

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.