WP_Comments_List_Table::column_response()publicWP 1.0

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

Хуков нет.

Возвращает

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

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

$WP_Comments_List_Table = new WP_Comments_List_Table();
$WP_Comments_List_Table->column_response( $comment );
$comment(WP_Comment) (обязательный)
The comment object.

Код WP_Comments_List_Table::column_response() WP 6.5.2

public function column_response( $comment ) {
	$post = get_post();

	if ( ! $post ) {
		return;
	}

	if ( isset( $this->pending_count[ $post->ID ] ) ) {
		$pending_comments = $this->pending_count[ $post->ID ];
	} else {
		$_pending_count_temp              = get_pending_comments_num( array( $post->ID ) );
		$pending_comments                 = $_pending_count_temp[ $post->ID ];
		$this->pending_count[ $post->ID ] = $pending_comments;
	}

	if ( current_user_can( 'edit_post', $post->ID ) ) {
		$post_link  = "<a href='" . get_edit_post_link( $post->ID ) . "' class='comments-edit-item-link'>";
		$post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
	} else {
		$post_link = esc_html( get_the_title( $post->ID ) );
	}

	echo '<div class="response-links">';

	if ( 'attachment' === $post->post_type ) {
		$thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true );
		if ( $thumb ) {
			echo $thumb;
		}
	}

	echo $post_link;

	$post_type_object = get_post_type_object( $post->post_type );
	echo "<a href='" . get_permalink( $post->ID ) . "' class='comments-view-item-link'>" . $post_type_object->labels->view_item . '</a>';

	echo '<span class="post-com-count-wrapper post-com-count-', $post->ID, '">';
	$this->comments_bubble( $post->ID, $pending_comments );
	echo '</span> ';

	echo '</div>';
}