钩子文档

post_type_archive_link

💡 云策文档标注

概述

post_type_archive_link 是一个 WordPress 过滤器,用于修改自定义文章类型归档页面的永久链接。它允许开发者在生成链接时进行自定义处理。

关键要点

  • 过滤器名称:post_type_archive_link
  • 参数:$link(归档链接字符串)和 $post_type(文章类型名称)
  • 源调用:apply_filters('post_type_archive_link', $link, $post_type)
  • 相关函数:get_post_type_archive_link() 用于获取归档链接
  • 引入版本:WordPress 3.1.0

📄 原文内容

Filters the post type archive permalink.

Parameters

$linkstring
The post type archive permalink.
$post_typestring
Post type name.

Source

return apply_filters( 'post_type_archive_link', $link, $post_type );

Changelog

Version Description
3.1.0 Introduced.