get_post_gallery_images() WordPress Function
The get_post_gallery_images() function allows you to retrieve the images from a gallery post.
get_post_gallery_images( int|WP_Post $post ) #
Checks a post’s content for galleries and return the image srcs for the first found gallery
Description
See also
Parameters
Return
(string[]) A list of a gallery's image srcs in order.
Source
File: wp-includes/media.php
function get_post_gallery_images( $post = 0 ) {
$gallery = get_post_gallery( $post, false );
return empty( $gallery['src'] ) ? array() : $gallery['src'];
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |