wp/wp-admin/includes/class-wp-comments-list-table.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    59 	 * Adds avatars to comment author names.
    59 	 * Adds avatars to comment author names.
    60 	 *
    60 	 *
    61 	 * @since 3.1.0
    61 	 * @since 3.1.0
    62 	 *
    62 	 *
    63 	 * @param string $name       Comment author name.
    63 	 * @param string $name       Comment author name.
    64 	 * @param int    $comment_ID Comment ID.
    64 	 * @param int    $comment_id Comment ID.
    65 	 * @return string Avatar with the user name.
    65 	 * @return string Avatar with the user name.
    66 	 */
    66 	 */
    67 	public function floated_admin_avatar( $name, $comment_ID ) {
    67 	public function floated_admin_avatar( $name, $comment_id ) {
    68 		$comment = get_comment( $comment_ID );
    68 		$comment = get_comment( $comment_id );
    69 		$avatar  = get_avatar( $comment, 32, 'mystery' );
    69 		$avatar  = get_avatar( $comment, 32, 'mystery' );
    70 		return "$avatar $name";
    70 		return "$avatar $name";
    71 	}
    71 	}
    72 
    72 
    73 	/**
    73 	/**
    93 		} else {
    93 		} else {
    94 			$mode = get_user_setting( 'posts_list_mode', 'list' );
    94 			$mode = get_user_setting( 'posts_list_mode', 'list' );
    95 		}
    95 		}
    96 
    96 
    97 		$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
    97 		$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
       
    98 
    98 		if ( ! in_array( $comment_status, array( 'all', 'mine', 'moderated', 'approved', 'spam', 'trash' ), true ) ) {
    99 		if ( ! in_array( $comment_status, array( 'all', 'mine', 'moderated', 'approved', 'spam', 'trash' ), true ) ) {
    99 			$comment_status = 'all';
   100 			$comment_status = 'all';
   100 		}
   101 		}
   101 
   102 
   102 		$comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
   103 		$comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
   160 		 * @param array $args An array of get_comments() arguments.
   161 		 * @param array $args An array of get_comments() arguments.
   161 		 */
   162 		 */
   162 		$args = apply_filters( 'comments_list_table_query_args', $args );
   163 		$args = apply_filters( 'comments_list_table_query_args', $args );
   163 
   164 
   164 		$_comments = get_comments( $args );
   165 		$_comments = get_comments( $args );
       
   166 
   165 		if ( is_array( $_comments ) ) {
   167 		if ( is_array( $_comments ) ) {
   166 			update_comment_cache( $_comments );
   168 			update_comment_cache( $_comments );
   167 
   169 
   168 			$this->items       = array_slice( $_comments, 0, $comments_per_page );
   170 			$this->items       = array_slice( $_comments, 0, $comments_per_page );
   169 			$this->extra_items = array_slice( $_comments, $comments_per_page );
   171 			$this->extra_items = array_slice( $_comments, $comments_per_page );
   196 	 * @param string $comment_status
   198 	 * @param string $comment_status
   197 	 * @return int
   199 	 * @return int
   198 	 */
   200 	 */
   199 	public function get_per_page( $comment_status = 'all' ) {
   201 	public function get_per_page( $comment_status = 'all' ) {
   200 		$comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
   202 		$comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
       
   203 
   201 		/**
   204 		/**
   202 		 * Filters the number of comments listed per page in the comments list table.
   205 		 * Filters the number of comments listed per page in the comments list table.
   203 		 *
   206 		 *
   204 		 * @since 2.6.0
   207 		 * @since 2.6.0
   205 		 *
   208 		 *
   282 		if ( ! EMPTY_TRASH_DAYS ) {
   285 		if ( ! EMPTY_TRASH_DAYS ) {
   283 			unset( $stati['trash'] );
   286 			unset( $stati['trash'] );
   284 		}
   287 		}
   285 
   288 
   286 		$link = admin_url( 'edit-comments.php' );
   289 		$link = admin_url( 'edit-comments.php' );
       
   290 
   287 		if ( ! empty( $comment_type ) && 'all' !== $comment_type ) {
   291 		if ( ! empty( $comment_type ) && 'all' !== $comment_type ) {
   288 			$link = add_query_arg( 'comment_type', $comment_type, $link );
   292 			$link = add_query_arg( 'comment_type', $comment_type, $link );
   289 		}
   293 		}
   290 
   294 
   291 		foreach ( $stati as $status => $label ) {
   295 		foreach ( $stati as $status => $label ) {
   310 			}
   314 			}
   311 
   315 
   312 			if ( ! isset( $num_comments->$status ) ) {
   316 			if ( ! isset( $num_comments->$status ) ) {
   313 				$num_comments->$status = 10;
   317 				$num_comments->$status = 10;
   314 			}
   318 			}
       
   319 
   315 			$link = add_query_arg( 'comment_status', $status, $link );
   320 			$link = add_query_arg( 'comment_status', $status, $link );
       
   321 
   316 			if ( $post_id ) {
   322 			if ( $post_id ) {
   317 				$link = add_query_arg( 'p', absint( $post_id ), $link );
   323 				$link = add_query_arg( 'p', absint( $post_id ), $link );
   318 			}
   324 			}
       
   325 
   319 			/*
   326 			/*
   320 			// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
   327 			// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
   321 			if ( !empty( $_REQUEST['s'] ) )
   328 			if ( !empty( $_REQUEST['s'] ) )
   322 				$link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link );
   329 				$link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link );
   323 			*/
   330 			*/
       
   331 
   324 			$status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf(
   332 			$status_links[ $status ] = "<a href='$link'$current_link_attributes>" . sprintf(
   325 				translate_nooped_plural( $label, $num_comments->$status ),
   333 				translate_nooped_plural( $label, $num_comments->$status ),
   326 				sprintf(
   334 				sprintf(
   327 					'<span class="%s-count">%s</span>',
   335 					'<span class="%s-count">%s</span>',
   328 					( 'moderated' === $status ) ? 'pending' : $status,
   336 					( 'moderated' === $status ) ? 'pending' : $status,
   350 	 */
   358 	 */
   351 	protected function get_bulk_actions() {
   359 	protected function get_bulk_actions() {
   352 		global $comment_status;
   360 		global $comment_status;
   353 
   361 
   354 		$actions = array();
   362 		$actions = array();
       
   363 
   355 		if ( in_array( $comment_status, array( 'all', 'approved' ), true ) ) {
   364 		if ( in_array( $comment_status, array( 'all', 'approved' ), true ) ) {
   356 			$actions['unapprove'] = __( 'Unapprove' );
   365 			$actions['unapprove'] = __( 'Unapprove' );
   357 		}
   366 		}
       
   367 
   358 		if ( in_array( $comment_status, array( 'all', 'moderated' ), true ) ) {
   368 		if ( in_array( $comment_status, array( 'all', 'moderated' ), true ) ) {
   359 			$actions['approve'] = __( 'Approve' );
   369 			$actions['approve'] = __( 'Approve' );
   360 		}
   370 		}
       
   371 
   361 		if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ), true ) ) {
   372 		if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ), true ) ) {
   362 			$actions['spam'] = _x( 'Mark as spam', 'comment' );
   373 			$actions['spam'] = _x( 'Mark as spam', 'comment' );
   363 		}
   374 		}
   364 
   375 
   365 		if ( 'trash' === $comment_status ) {
   376 		if ( 'trash' === $comment_status ) {
   388 		static $has_items;
   399 		static $has_items;
   389 
   400 
   390 		if ( ! isset( $has_items ) ) {
   401 		if ( ! isset( $has_items ) ) {
   391 			$has_items = $this->has_items();
   402 			$has_items = $this->has_items();
   392 		}
   403 		}
       
   404 
   393 		echo '<div class="alignleft actions">';
   405 		echo '<div class="alignleft actions">';
       
   406 
   394 		if ( 'top' === $which ) {
   407 		if ( 'top' === $which ) {
   395 			ob_start();
   408 			ob_start();
   396 
   409 
   397 			$this->comment_status_dropdown( $comment_type );
   410 			$this->comment_type_dropdown( $comment_type );
       
   411 
   398 			/**
   412 			/**
   399 			 * Fires just before the Filter submit button for comment types.
   413 			 * Fires just before the Filter submit button for comment types.
   400 			 *
   414 			 *
   401 			 * @since 3.5.0
   415 			 * @since 3.5.0
   402 			 */
   416 			 */
   404 
   418 
   405 			$output = ob_get_clean();
   419 			$output = ob_get_clean();
   406 
   420 
   407 			if ( ! empty( $output ) && $this->has_items() ) {
   421 			if ( ! empty( $output ) && $this->has_items() ) {
   408 				echo $output;
   422 				echo $output;
   409 				submit_button( esc_html__( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
   423 				submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
   410 			}
   424 			}
   411 		}
   425 		}
   412 
   426 
   413 		if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
   427 		if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && $has_items
       
   428 			&& current_user_can( 'moderate_comments' )
       
   429 		) {
   414 			wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
   430 			wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
   415 			$title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
   431 			$title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
   416 			submit_button( $title, 'apply', 'delete_all', false );
   432 			submit_button( $title, 'apply', 'delete_all', false );
   417 		}
   433 		}
       
   434 
   418 		/**
   435 		/**
   419 		 * Fires after the Filter submit button for comment types.
   436 		 * Fires after the Filter submit button for comment types.
   420 		 *
   437 		 *
   421 		 * @since 2.5.0
   438 		 * @since 2.5.0
       
   439 		 * @since 5.6.0 The `$which` parameter was added.
   422 		 *
   440 		 *
   423 		 * @param string $comment_status The comment status name. Default 'All'.
   441 		 * @param string $comment_status The comment status name. Default 'All'.
       
   442 		 * @param string $which          The location of the extra table nav markup: 'top' or 'bottom'.
   424 		 */
   443 		 */
   425 		do_action( 'manage_comments_nav', $comment_status );
   444 		do_action( 'manage_comments_nav', $comment_status, $which );
       
   445 
   426 		echo '</div>';
   446 		echo '</div>';
   427 	}
   447 	}
   428 
   448 
   429 	/**
   449 	/**
   430 	 * @return string|false
   450 	 * @return string|false
   463 
   483 
   464 		return $columns;
   484 		return $columns;
   465 	}
   485 	}
   466 
   486 
   467 	/**
   487 	/**
   468 	 * Displays a comment status drop-down for filtering on the Comments list table.
   488 	 * Displays a comment type drop-down for filtering on the Comments list table.
   469 	 *
   489 	 *
   470 	 * @since 5.5.0
   490 	 * @since 5.5.0
       
   491 	 * @since 5.6.0 Renamed from `comment_status_dropdown()` to `comment_type_dropdown()`.
   471 	 *
   492 	 *
   472 	 * @param string $comment_type The current comment type slug.
   493 	 * @param string $comment_type The current comment type slug.
   473 	 */
   494 	 */
   474 	protected function comment_status_dropdown( $comment_type ) {
   495 	protected function comment_type_dropdown( $comment_type ) {
   475 		/**
   496 		/**
   476 		 * Filters the comment types dropdown menu.
   497 		 * Filters the comment types shown in the drop-down menu on the Comments list table.
   477 		 *
   498 		 *
   478 		 * @since 2.7.0
   499 		 * @since 2.7.0
   479 		 *
   500 		 *
   480 		 * @param array $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
   501 		 * @param string[] $comment_types Array of comment type labels keyed by their name.
   481 		 */
   502 		 */
   482 		$comment_types = apply_filters(
   503 		$comment_types = apply_filters(
   483 			'admin_comment_types_dropdown',
   504 			'admin_comment_types_dropdown',
   484 			array(
   505 			array(
   485 				'comment' => esc_html__( 'Comments' ),
   506 				'comment' => __( 'Comments' ),
   486 				'pings'   => esc_html__( 'Pings' ),
   507 				'pings'   => __( 'Pings' ),
   487 			)
   508 			)
   488 		);
   509 		);
   489 
   510 
   490 		if ( $comment_types && is_array( $comment_types ) ) {
   511 		if ( $comment_types && is_array( $comment_types ) ) {
   491 			printf( '<label class="screen-reader-text" for="filter-by-comment-type">%s</label>', esc_html__( 'Filter by comment type' ) );
   512 			printf( '<label class="screen-reader-text" for="filter-by-comment-type">%s</label>', __( 'Filter by comment type' ) );
   492 
   513 
   493 			echo '<select id="filter-by-comment-type" name="comment_type">';
   514 			echo '<select id="filter-by-comment-type" name="comment_type">';
   494 
   515 
   495 			printf( "\t<option value=''>%s</option>", esc_html__( 'All comment types' ) );
   516 			printf( "\t<option value=''>%s</option>", __( 'All comment types' ) );
   496 
   517 
   497 			foreach ( $comment_types as $type => $label ) {
   518 			foreach ( $comment_types as $type => $label ) {
   498 				if ( get_comments(
   519 				if ( get_comments(
   499 					array(
   520 					array(
   500 						'number' => 1,
   521 						'number' => 1,
   507 						selected( $comment_type, $type, false ),
   528 						selected( $comment_type, $type, false ),
   508 						esc_html( $label )
   529 						esc_html( $label )
   509 					);
   530 					);
   510 				}
   531 				}
   511 			}
   532 			}
   512 				echo '</select>';
   533 
       
   534 			echo '</select>';
   513 		}
   535 		}
   514 	}
   536 	}
   515 
   537 
   516 	/**
   538 	/**
   517 	 * @return array
   539 	 * @return array
   546 		wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
   568 		wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
   547 		static $has_items;
   569 		static $has_items;
   548 
   570 
   549 		if ( ! isset( $has_items ) ) {
   571 		if ( ! isset( $has_items ) ) {
   550 			$has_items = $this->has_items();
   572 			$has_items = $this->has_items();
       
   573 
   551 			if ( $has_items ) {
   574 			if ( $has_items ) {
   552 				$this->display_tablenav( 'top' );
   575 				$this->display_tablenav( 'top' );
   553 			}
   576 			}
   554 		}
   577 		}
   555 
   578 
   602 		global $post, $comment;
   625 		global $post, $comment;
   603 
   626 
   604 		$comment = $item;
   627 		$comment = $item;
   605 
   628 
   606 		$the_comment_class = wp_get_comment_status( $comment );
   629 		$the_comment_class = wp_get_comment_status( $comment );
       
   630 
   607 		if ( ! $the_comment_class ) {
   631 		if ( ! $the_comment_class ) {
   608 			$the_comment_class = '';
   632 			$the_comment_class = '';
   609 		}
   633 		}
   610 		$the_comment_class = join( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) );
   634 
       
   635 		$the_comment_class = implode( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) );
   611 
   636 
   612 		if ( $comment->comment_post_ID > 0 ) {
   637 		if ( $comment->comment_post_ID > 0 ) {
   613 			$post = get_post( $comment->comment_post_ID );
   638 			$post = get_post( $comment->comment_post_ID );
   614 		}
   639 		}
       
   640 
   615 		$this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
   641 		$this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
   616 
   642 
   617 		echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
   643 		echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
   618 		$this->single_row_columns( $comment );
   644 		$this->single_row_columns( $comment );
   619 		echo "</tr>\n";
   645 		echo "</tr>\n";
   822 			if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) {
   848 			if ( ( 'reply' === $action || 'quickedit' === $action ) && ! wp_doing_ajax() ) {
   823 				$action .= ' hide-if-no-js';
   849 				$action .= ' hide-if-no-js';
   824 			} elseif ( ( 'untrash' === $action && 'trash' === $the_comment_status )
   850 			} elseif ( ( 'untrash' === $action && 'trash' === $the_comment_status )
   825 				|| ( 'unspam' === $action && 'spam' === $the_comment_status )
   851 				|| ( 'unspam' === $action && 'spam' === $the_comment_status )
   826 			) {
   852 			) {
   827 				if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) {
   853 				if ( '1' === get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) {
   828 					$action .= ' approve';
   854 					$action .= ' approve';
   829 				} else {
   855 				} else {
   830 					$action .= ' unapprove';
   856 					$action .= ' unapprove';
   831 				}
   857 				}
   832 			}
   858 			}
   861 			$this->column_author( $comment );
   887 			$this->column_author( $comment );
   862 		echo '</div>';
   888 		echo '</div>';
   863 
   889 
   864 		if ( $comment->comment_parent ) {
   890 		if ( $comment->comment_parent ) {
   865 			$parent = get_comment( $comment->comment_parent );
   891 			$parent = get_comment( $comment->comment_parent );
       
   892 
   866 			if ( $parent ) {
   893 			if ( $parent ) {
   867 				$parent_link = esc_url( get_comment_link( $parent ) );
   894 				$parent_link = esc_url( get_comment_link( $parent ) );
   868 				$name        = get_comment_author( $parent );
   895 				$name        = get_comment_author( $parent );
   869 				printf(
   896 				printf(
   870 					/* translators: %s: Comment link. */
   897 					/* translators: %s: Comment link. */
   900 		global $comment_status;
   927 		global $comment_status;
   901 
   928 
   902 		$author_url = get_comment_author_url( $comment );
   929 		$author_url = get_comment_author_url( $comment );
   903 
   930 
   904 		$author_url_display = untrailingslashit( preg_replace( '|^http(s)?://(www\.)?|i', '', $author_url ) );
   931 		$author_url_display = untrailingslashit( preg_replace( '|^http(s)?://(www\.)?|i', '', $author_url ) );
       
   932 
   905 		if ( strlen( $author_url_display ) > 50 ) {
   933 		if ( strlen( $author_url_display ) > 50 ) {
   906 			$author_url_display = wp_html_excerpt( $author_url_display, 49, '&hellip;' );
   934 			$author_url_display = wp_html_excerpt( $author_url_display, 49, '&hellip;' );
   907 		}
   935 		}
   908 
   936 
   909 		echo '<strong>';
   937 		echo '<strong>';
   910 		comment_author( $comment );
   938 		comment_author( $comment );
   911 		echo '</strong><br />';
   939 		echo '</strong><br />';
       
   940 
   912 		if ( ! empty( $author_url_display ) ) {
   941 		if ( ! empty( $author_url_display ) ) {
   913 			printf( '<a href="%s">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) );
   942 			printf( '<a href="%s">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) );
   914 		}
   943 		}
   915 
   944 
   916 		if ( $this->user_can ) {
   945 		if ( $this->user_can ) {
   922 					printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) );
   951 					printf( '<a href="%1$s">%2$s</a><br />', esc_url( 'mailto:' . $email ), esc_html( $email ) );
   923 				}
   952 				}
   924 			}
   953 			}
   925 
   954 
   926 			$author_ip = get_comment_author_IP( $comment );
   955 			$author_ip = get_comment_author_IP( $comment );
       
   956 
   927 			if ( $author_ip ) {
   957 			if ( $author_ip ) {
   928 				$author_ip_url = add_query_arg(
   958 				$author_ip_url = add_query_arg(
   929 					array(
   959 					array(
   930 						's'    => $author_ip,
   960 						's'    => $author_ip,
   931 						'mode' => 'detail',
   961 						'mode' => 'detail',
   932 					),
   962 					),
   933 					admin_url( 'edit-comments.php' )
   963 					admin_url( 'edit-comments.php' )
   934 				);
   964 				);
       
   965 
   935 				if ( 'spam' === $comment_status ) {
   966 				if ( 'spam' === $comment_status ) {
   936 					$author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
   967 					$author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
   937 				}
   968 				}
       
   969 
   938 				printf( '<a href="%1$s">%2$s</a>', esc_url( $author_ip_url ), esc_html( $author_ip ) );
   970 				printf( '<a href="%1$s">%2$s</a>', esc_url( $author_ip_url ), esc_html( $author_ip ) );
   939 			}
   971 			}
   940 		}
   972 		}
   941 	}
   973 	}
   942 
   974 
   945 	 */
   977 	 */
   946 	public function column_date( $comment ) {
   978 	public function column_date( $comment ) {
   947 		$submitted = sprintf(
   979 		$submitted = sprintf(
   948 			/* translators: 1: Comment date, 2: Comment time. */
   980 			/* translators: 1: Comment date, 2: Comment time. */
   949 			__( '%1$s at %2$s' ),
   981 			__( '%1$s at %2$s' ),
   950 			/* translators: Comment date format. See https://www.php.net/date */
   982 			/* translators: Comment date format. See https://www.php.net/manual/datetime.format.php */
   951 			get_comment_date( __( 'Y/m/d' ), $comment ),
   983 			get_comment_date( __( 'Y/m/d' ), $comment ),
   952 			/* translators: Comment time format. See https://www.php.net/date */
   984 			/* translators: Comment time format. See https://www.php.net/manual/datetime.format.php */
   953 			get_comment_date( __( 'g:i a' ), $comment )
   985 			get_comment_date( __( 'g:i a' ), $comment )
   954 		);
   986 		);
   955 
   987 
   956 		echo '<div class="submitted-on">';
   988 		echo '<div class="submitted-on">';
       
   989 
   957 		if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
   990 		if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
   958 			printf(
   991 			printf(
   959 				'<a href="%s">%s</a>',
   992 				'<a href="%s">%s</a>',
   960 				esc_url( get_comment_link( $comment ) ),
   993 				esc_url( get_comment_link( $comment ) ),
   961 				$submitted
   994 				$submitted
   962 			);
   995 			);
   963 		} else {
   996 		} else {
   964 			echo $submitted;
   997 			echo $submitted;
   965 		}
   998 		}
       
   999 
   966 		echo '</div>';
  1000 		echo '</div>';
   967 	}
  1001 	}
   968 
  1002 
   969 	/**
  1003 	/**
   970 	 * @param WP_Comment $comment The comment object.
  1004 	 * @param WP_Comment $comment The comment object.
   990 		} else {
  1024 		} else {
   991 			$post_link = esc_html( get_the_title( $post->ID ) );
  1025 			$post_link = esc_html( get_the_title( $post->ID ) );
   992 		}
  1026 		}
   993 
  1027 
   994 		echo '<div class="response-links">';
  1028 		echo '<div class="response-links">';
       
  1029 
   995 		if ( 'attachment' === $post->post_type ) {
  1030 		if ( 'attachment' === $post->post_type ) {
   996 			$thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true );
  1031 			$thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true );
   997 			if ( $thumb ) {
  1032 			if ( $thumb ) {
   998 				echo $thumb;
  1033 				echo $thumb;
   999 			}
  1034 			}
  1000 		}
  1035 		}
       
  1036 
  1001 		echo $post_link;
  1037 		echo $post_link;
       
  1038 
  1002 		$post_type_object = get_post_type_object( $post->post_type );
  1039 		$post_type_object = get_post_type_object( $post->post_type );
  1003 		echo "<a href='" . get_permalink( $post->ID ) . "' class='comments-view-item-link'>" . $post_type_object->labels->view_item . '</a>';
  1040 		echo "<a href='" . get_permalink( $post->ID ) . "' class='comments-view-item-link'>" . $post_type_object->labels->view_item . '</a>';
       
  1041 
  1004 		echo '<span class="post-com-count-wrapper post-com-count-', $post->ID, '">';
  1042 		echo '<span class="post-com-count-wrapper post-com-count-', $post->ID, '">';
  1005 		$this->comments_bubble( $post->ID, $pending_comments );
  1043 		$this->comments_bubble( $post->ID, $pending_comments );
  1006 		echo '</span> ';
  1044 		echo '</span> ';
       
  1045 
  1007 		echo '</div>';
  1046 		echo '</div>';
  1008 	}
  1047 	}
  1009 
  1048 
  1010 	/**
  1049 	/**
  1011 	 * @param WP_Comment $comment     The comment object.
  1050 	 * @param WP_Comment $comment     The comment object.
  1016 		 * Fires when the default column output is displayed for a single row.
  1055 		 * Fires when the default column output is displayed for a single row.
  1017 		 *
  1056 		 *
  1018 		 * @since 2.8.0
  1057 		 * @since 2.8.0
  1019 		 *
  1058 		 *
  1020 		 * @param string $column_name The custom column's name.
  1059 		 * @param string $column_name The custom column's name.
  1021 		 * @param int    $comment_ID  The custom column's unique ID number.
  1060 		 * @param int    $comment_id  The custom column's unique ID number.
  1022 		 */
  1061 		 */
  1023 		do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
  1062 		do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
  1024 	}
  1063 	}
  1025 }
  1064 }