钩子文档

get_the_modified_date

💡 云策文档标注

概述

get_the_modified_date 是一个 WordPress 过滤器,用于修改文章最后修改日期的输出格式。它允许开发者自定义日期显示方式,并支持传入文章对象参数。

关键要点

  • 这是一个过滤器,用于过滤文章最后修改日期。
  • 参数包括:$the_time(格式化日期或 false)、$format(PHP 日期格式)、$post(WP_Post 对象或 null)。
  • 源返回:apply_filters('get_the_modified_date', $the_time, $format, $post)。
  • 相关函数:get_the_modified_date() 用于检索文章最后修改日期。
  • 版本变更:4.6.0 添加了 $post 参数,2.1.0 引入。

📄 原文内容

Filters the date a post was last modified.

Parameters

$the_timestring|int|false
The formatted date or false if no post is found.
$formatstring
PHP date format.
$postWP_Post|null
WP_Post object or null if no post is found.

Source

return apply_filters( 'get_the_modified_date', $the_time, $format, $post );

Changelog

Version Description
4.6.0 Added the $post parameter.
2.1.0 Introduced.