get_tags_to_edit()
云策文档标注
概述
get_tags_to_edit() 函数用于获取可编辑标签的逗号分隔列表。它基于 get_terms_to_edit() 实现,支持指定分类法参数。
关键要点
- 函数返回可编辑标签的逗号分隔字符串,失败时返回 false 或 WP_Error。
- 参数 $post_id 为必需,指定文章 ID;$taxonomy 可选,默认为 'post_tag'。
- 函数是 get_terms_to_edit() 的包装器,自 WordPress 2.3.0 版本引入。
原文内容
Gets comma-separated list of tags available to edit.
Parameters
$post_idintrequired$taxonomystringoptional-
The taxonomy for which to retrieve terms. Default
'post_tag'.
Source
function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) {
return get_terms_to_edit( $post_id, $taxonomy );
}
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |