permalink_link()
云策文档标注
概述
permalink_link() 是一个已弃用的 WordPress 函数,用于在循环中打印当前文章的固定链接。自版本 1.2.0 起,建议使用 the_permalink() 替代。
关键要点
- permalink_link() 函数已弃用,自 WordPress 1.2.0 版本起,应改用 the_permalink() 函数。
- 该函数直接调用 the_permalink() 来显示当前文章的固定链接,主要用于向后兼容。
- 相关函数包括 the_permalink() 和 _deprecated_function(),后者用于标记已弃用函数并通知使用情况。
注意事项
在开发新主题或插件时,避免使用 permalink_link(),以遵循 WordPress 最佳实践并确保代码兼容性。
原文内容
Print the permalink of the current post in the loop.
Description
See also
Source
function permalink_link() {
_deprecated_function( __FUNCTION__, '1.2.0', 'the_permalink()' );
the_permalink();
}
Changelog
| Version | Description |
|---|---|
| 1.2.0 | Deprecated. Use the_permalink() |
| 0.71 | Introduced. |