钩子文档

the_modified_date

💡 云策文档标注

概述

the_modified_date 是一个 WordPress 过滤器,用于修改文章最后修改日期的显示格式和输出内容。它允许开发者自定义日期格式、前后 HTML 包装。

关键要点

  • 过滤器名称:the_modified_date
  • 参数:$the_modified_date(日期字符串)、$format(PHP 日期格式)、$before(日期前 HTML)、$after(日期后 HTML)
  • 应用方式:通过 apply_filters 调用,用于 the_modified_date() 函数
  • 相关函数:the_modified_date() 用于显示文章最后修改日期
  • 引入版本:WordPress 2.1.0

📄 原文内容

Filters the date a post was last modified, for display.

Parameters

$the_modified_datestring
The last modified date.
$formatstring
PHP date format.
$beforestring
HTML output before the date.
$afterstring
HTML output after the date.

Source

$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );

Changelog

Version Description
2.1.0 Introduced.