wpseek.com
A WordPress-centric search engine for devs and theme authors



get_post_gallery_images › WordPress Function

Since3.6.0
Deprecatedn/a
get_post_gallery_images ( $post = 0 )
Parameters:
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global `$post`.
    Required: No
    Default:
See:
Returns:
  • (string[]) A list of a gallery's image srcs in order.
Defined at:
Codex:

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



Source

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