WordPress开发者和主题制作者的搜索引擎



get_post_gallery_images ›

Since3.6.0
已弃用n/a
get_post_gallery_images ( $post = 0 )
参数:
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global `$post`.
    Required: No
    默认:
查看:
返回:
  • (array) A list of a gallery's image srcs in order.
定义在:
文档:

Checks a post's content for galleries and return the image srcs for the first found gallery



源码

function get_post_gallery_images( $post = 0 ) {
	$gallery = get_post_gallery( $post, false );
	return empty( $gallery['src'] ) ? array() : $gallery['src'];
}