GC_Comments_List_Table::column_response()
最后更新于:2021-11-26 22:30:37
GC_Comments_List_Table::column_response( GC_Comment$comment)参数
- $comment
-
(GC_Comment) (Required) The comment object.
源文件
文件: gc-admin/includes/class-gc-comments-list-table.php
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 = gc_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>';
}