钩子文档

the_author_link

💡 云策文档标注

概述

the_author_link 是一个 WordPress 过滤器钩子,用于修改作者链接的 HTML 输出。它允许开发者在渲染作者链接时自定义其 HTML 内容。

关键要点

  • the_author_link 是一个过滤器钩子,用于过滤作者 URL 链接的 HTML。
  • 它接受三个参数:$link(默认渲染的作者 HTML 链接)、$author_url(作者的 URL)和 $authordata(作者的用户数据,类型为 WP_User)。
  • 该钩子在 WordPress 6.0.0 版本中引入。
  • 相关函数 get_the_author_link() 用于检索作者的链接或名称。

📄 原文内容

Filters the author URL link HTML.

Parameters

$linkstring
The default rendered author HTML link.
$author_urlstring
Author’s URL.
$authordataWP_User
Author user data.

Source

return apply_filters( 'the_author_link', $link, $author_url, $authordata );

Changelog

Version Description
6.0.0 Introduced.