Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
comment_date() - 显示当前评论的评论日期 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / comment_date()

comment_date( string $format = '', int|WP_Comment $comment_ID )

显示当前评论的评论日期


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 2 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "8a120dc4a793b62501729a9a51316687" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "1eb1c6a1b1d64fca20620178efd0ef14" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

comment 评论more...

datemore...


参数

$format

(string)(可选) PHP日期格式。默认为'date_format'选项。

默认值: ''

$comment_ID

(int|WP_Comment)(可选) WP_Comment或要打印日期的评论的ID。默认当前评论。


说明

有关日期的格式,请参见格式化日期和时间。



源码

查看源码 官方文档


更新日志

版本描述
4.4.0增加了$comment_ID也能接受WP_Comment对象的能力。
0.71开始引入

使用示例

  • 示例1

    基本示例

    以“6-30-2004”格式显示当前评论日期:

    <div>Comment posted on <?php comment_date('n-j-Y'); ?></div>