list_pages
云策文档标注
概述
list_pages 过滤器用于在生成页面下拉列表的 HTML 时修改页面标题。它允许开发者在 Walker_PageDropdown::start_el() 方法中自定义标题输出。
关键要点
- 过滤器名称:list_pages
- 参数:$title(页面标题字符串)和 $page(WP_Post 对象)
- 调用方式:apply_filters('list_pages', $title, $page)
- 相关函数:Walker_PageDropdown::start_el()
- 引入版本:WordPress 3.1.0
原文内容
Filters the page title when creating an HTML drop-down list of pages.
Parameters
$titlestring-
Page title.
$pageWP_Post-
Page data object.
Source
$title = apply_filters( 'list_pages', $title, $page );
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |