the_meta_key
云策文档标注
概述
the_meta_key 是一个 WordPress 过滤器钩子,用于修改文章自定义字段列表中 li 元素的 HTML 输出。它允许开发者自定义显示格式,通常与 the_meta() 函数配合使用。
关键要点
- 过滤器名称:the_meta_key
- 作用:过滤文章自定义字段列表中 li 元素的 HTML 输出
- 参数:$html(HTML 输出字符串)、$key(元键)、$value(元值)
- 相关函数:the_meta() 用于显示文章自定义字段列表
- 引入版本:WordPress 2.2.0
原文内容
Filters the HTML output of the li element in the post custom fields list.
Parameters
$htmlstring-
The HTML output for the li element.
$keystring-
Meta key.
$valuestring-
Meta value.
Source
$li_html .= apply_filters( 'the_meta_key', $html, $key, $value );
Changelog
| Version | Description |
|---|---|
| 2.2.0 | Introduced. |