comment_date

函式
comment_date ( $format = '', $comment_ID = 0 )
引數
  • (string) $format Optional. PHP date format. Defaults to the 'date_format' option.
    Required:
    Default: (empty)
  • (int|WP_Comment) $comment_ID WP_Comment or ID of the comment for which to print the date. Default current comment.
    Required:
定義位置
相關方法
get_comment_datecomment_typecomment_timecomment_textcomment_id
引入
0.71
棄用
-

comment_date用來顯示評論釋出的日期。它需要一個引數,即顯示日期的格式。預設格式是’F j, Y \a\t g:i a’,它以人類可讀的格式顯示日期(例如,2023年1月1日下午2:30)。

顯示當前評論的評論日期。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function comment_date( $format = '', $comment_ID = 0 ) {
echo get_comment_date( $format, $comment_ID );
}
function comment_date( $format = '', $comment_ID = 0 ) { echo get_comment_date( $format, $comment_ID ); }
function comment_date( $format = '', $comment_ID = 0 ) {
	echo get_comment_date( $format, $comment_ID );
}

常見問題

FAQs
檢視更多 >