WordPress函数:the_modified_date
一、函数简介
显示上次修改帖子的日期。(Displays the date on which the post was last modified.)二、函数参数
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param string $before Optional. Output before the date. Default empty. * @param string $after Optional. Output after the date. Default empty. * @param bool $display Optional. Whether to echo the date or return it. Default true. * @return string|void String if retrieving.三、函数案例
<?php the_modified_date( $format = '', $before = '', $after = '', $display = true ) ?>
四、源代码
/**
* Displays the date on which the post was last modified.
*
* @since 2.1.0
*
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
* @param string $before Optional. Output before the date. Default empty.
* @param string $after Optional. Output after the date. Default empty.
* @param bool $display Optional. Whether to echo the date or return it. Default true.
* @return string|void String if retrieving.
*/
function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
$the_modified_date = $before . get_the_modified_date( $format ) . $after;
/**
* Filters the date a post was last modified, for display.
*
* @since 2.1.0
*
* @param string $the_modified_date The last modified date.
* @param string $format PHP date format.
* @param string $before HTML output before the date.
* @param string $after HTML output after the date.
*/
$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );
if ( $display ) {
echo $the_modified_date;
} else {
return $the_modified_date;
}
}
THE END