get_post_galleries_images() WordPress Function
The get_post_galleries_images() function enables you to retrieve all images associated with a post, including images from any galleries attached to the post. This function can be used in your template files to output the images in a post gallery.
get_post_galleries_images( int|WP_Post $post ) #
Retrieve the image srcs from galleries from a post’s content, if present
Description
See also
Parameters
Return
(array) A list of lists, each containing image srcs parsed. from an expanded shortcode
Source
File: wp-includes/media.php
function get_post_galleries_images( $post = 0 ) { $galleries = get_post_galleries( $post, false ); return wp_list_pluck( $galleries, 'src' ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |