函数文档

the_modified_author()

💡 云策文档标注

概述

the_modified_author() 是一个 WordPress 模板标签,用于在主题文件中直接输出最后编辑当前文章的作者名称,前提是作者 ID 可用。它基于 get_the_modified_author() 函数实现。

关键要点

  • the_modified_author() 直接输出最后编辑文章的作者名称,适用于主题模板中显示作者信息。
  • 此函数依赖于 get_the_modified_author() 来获取作者数据,如果作者 ID 不可用,可能不显示内容。
  • 自 WordPress 2.8.0 版本引入,属于作者模板函数的一部分,位于 wp-includes/author-template.php 文件中。

注意事项

使用时需确保文章有可用的最后编辑作者 ID,否则可能无输出;建议在循环内使用以获取正确的文章上下文。


📄 原文内容

Displays the name of the author who last edited the current post, if the author’s ID is available.

Description

See also

Source

function the_modified_author() {
	echo get_the_modified_author();
}

Changelog

Version Description
2.8.0 Introduced.

User Contributed Notes