WordPress函数:comment_time 显示当前评论的评论时间

江河/ 2023年06月13日/ WordPress/ 浏览 901

函数原型:


comment_time( string $format = '', int|WP_Comment $comment_id )


显示当前评论的评论时间。


参数说明:


$format,PHP时间格式。默认为“time_format”选项。


$comment_id,要打印其时间的评论的WP_Comment或ID。默认当前评论。


函数源码:


function comment_time( $format = '', $comment_id = 0 ) {
	echo get_comment_time( $format, $comment_id );
}


使用举例:


<p>comment timestamp: <?php comment_time( 'H:i:s' ); ?></p>


发表评论

暂无评论,抢个沙发...

客服 工单