函数原型
get_post_galleries_images( int|WP_Post $post ): array
函数描述
Retrieves the image srcs from galleries from a post’s content, if present.
是否弃用
未弃用
函数参数
-
$post
int|WP_Post
Optional - Post ID or WP_Post object. Default is global
$post.
函数返回值
array A list of lists, each containing image srcs parsed.
from an expanded shortcode
函数位置
File: wp-includes/media.php.
函数源码
function get_post_galleries_images( $post = 0 ) {
$galleries = get_post_galleries( $post, false );
return wp_list_pluck( $galleries, 'src' );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |

