1. 首页
  2. WordPress钩子手册

get_archives_link

apply_filters( ‘get_archives_link’, string $link_html, string $url, string $text, string $format, string $before, string $after, bool $selected )

筛选挂钩:筛选存档链接内容。
Filter Hook: Filters the archive link content.

目录锚点:#参数#源码#笔记


参数(Parameters)

参数 类型 说明
$link_html (string) 存档HTML链接内容。
$url (string) 存档的URL。
$text (string) 存档文本说明。
$format (string) 链接格式。可以是“link”、“option”、“html”或custom。
$before (string) 要添加到说明前面的内容。
$after (string) 要附加到描述的内容。
$selected (bool) 如果当前页是选定的存档,则为True。

源码(Source)


更新版本 源码位置 使用 被使用
5.2.0 wp-includes/general-template.php:1769 1 0

笔记(Notes)

可以使用此筛选器将当前存档类添加到元素(作为wp_list_categories()函数中的当前cat):

get_archives_link 为WP2原创文章,链接:https://www.wp2.cn/hook/get_archives_link-2/