post_type_archive_title
云策文档标注
概述
post_type_archive_title 是一个 WordPress 过滤器,用于修改或过滤自定义文章类型存档页面的标题。它允许开发者根据文章类型名称或对象动态调整标题显示。
关键要点
- 过滤器名称:post_type_archive_title
- 参数:$post_type_name(字符串,文章类型的 'name' 标签)和 $post_type(字符串,文章类型)
- 用法示例:通过 apply_filters 调用,传递文章类型对象的 labels->name 和文章类型作为参数
- 相关函数:post_type_archive_title() 用于显示或检索文章类型存档标题
- 引入版本:WordPress 3.1.0
原文内容
Filters the post type archive title.
Parameters
$post_type_namestring-
Post type
'name'label. $post_typestring-
Post type.
Source
$title = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name, $post_type );
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |