the_author_url()
云策文档标注
概述
the_author_url() 是一个已弃用的 WordPress 模板标签,用于显示当前文章作者的主页 URL。自 2.8.0 版本起,建议使用 the_author_meta('url') 替代。
关键要点
- the_author_url() 已被弃用,自 WordPress 2.8.0 起推荐使用 the_author_meta('url')。
- 该函数直接调用 the_author_meta('url') 来输出作者主页 URL。
- 相关函数包括 the_author_meta() 用于输出用户数据库对象字段,以及 _deprecated_function() 用于标记弃用函数。
代码示例
function the_author_url() {
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta('url')' );
the_author_meta('url');
}注意事项
- 在开发中应避免使用 the_author_url(),改用 the_author_meta('url') 以确保兼容性和最佳实践。
- 弃用信息通过 _deprecated_function() 记录,有助于调试和更新代码。
原文内容
Display the URL to the home page of the author of the current post.
Description
See also
Source
function the_author_url() {
_deprecated_function( __FUNCTION__, '2.8.0', 'the_author_meta('url')' );
the_author_meta('url');
}
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Deprecated. Use the_author_meta() |
| 0.71 | Introduced. |