get_post_galleries()
get_post_galleries( int|WP_Post $post, bool $html = true )
从传递的帖子内容中检索库。
Retrieves galleries from the passed post’s content.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post | (int | WP_Post) | 必需 | Post ID或对象。 |
$html | (bool) | 可选 | 是返回HTML还是返回数组中的数据。 |
返回(Return)
(array)数组的列表,每个数组都包含从扩展的快捷方式解析的库数据和src。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.6.0 | wp-includes/media.php:4158 | 2 | 7 |
笔记(Notes)
此函数不支持块编辑器库。它只适用于旧的gallery快捷方式。块库的内容包含在块本身中。
get_post_galleries() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_post_galleries/