GC_Comments_List_Table::column_date()

最后更新于:2021-11-26 22:30:08

GC_Comments_List_Table::column_date( GC_Comment$comment)

参数

$comment

(GC_Comment) (Required) The comment object.

源文件

文件: gc-admin/includes/class-gc-comments-list-table.php

	public function column_date( $comment ) {
		$submitted = sprintf(
			/* translators: 1: Comment date, 2: Comment time. */
			__( '%1$s at %2$s' ),
			/* translators: Comment date format. See https://www.php.net/manual/datetime.format.php */
			get_comment_date( __( 'Y/m/d' ), $comment ),
			/* translators: Comment time format. See https://www.php.net/manual/datetime.format.php */
			get_comment_date( __( 'g:i a' ), $comment )
		);

		echo '<div class="submitted-on">';

		if ( 'approved' === gc_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
			printf(
				'<a href="https://docs.gechiui.com/classes/gc_comments_list_table/column_date/%s">%s</a>',
				esc_url( get_comment_link( $comment ) ),
				$submitted
			);
		} else {
			echo $submitted;
		}

		echo '</div>';
	}