get_enclosed
云策文档标注
概述
get_enclosed 是一个 WordPress 过滤器,用于修改已附加到指定文章的附件列表。它允许开发者在获取附件时自定义或过滤数据。
关键要点
- 过滤器名称:get_enclosed
- 参数:$pung(附件数组)和 $post_id(文章 ID)
- 用途:过滤已附加到文章的附件列表
- 相关函数:get_enclosed() 用于检索附件
代码示例
apply_filters( 'get_enclosed', $pung, $post_id );注意事项
- 引入版本:WordPress 2.0.0
- 源文件位置:wp-includes/post.php
原文内容
Filters the list of enclosures already enclosed for the given post.
Parameters
$pungstring[]-
Array of enclosures for the given post.
$post_idint-
Post ID.
Source
return apply_filters( 'get_enclosed', $pung, $post_id );
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |