get_post_galleries
云策文档标注
概述
get_post_galleries 是一个 WordPress 过滤器,用于修改从指定文章中检索到的所有图库列表。它允许开发者自定义图库数据的处理方式。
关键要点
- 过滤器名称:get_post_galleries
- 参数:$galleries(关联数组,包含所有找到的图库)和 $post(WP_Post 对象)
- 用途:在 get_post_galleries() 函数中应用,用于过滤文章内容中的图库数据
- 相关函数:get_post_galleries() 位于 wp-includes/media.php,用于从文章内容中检索图库
- 引入版本:WordPress 3.6.0
原文内容
Filters the list of all found galleries in the given post.
Parameters
$galleriesarray-
Associative array of all found post galleries.
$postWP_Post-
Post object.
Source
return apply_filters( 'get_post_galleries', $galleries, $post );
Changelog
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |