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

$post

(int|WP_Post) (Optional) Post ID or WP_Post object. Default is global $post.

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' );
}

Changelog

Version Description
3.6.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_post_galleries_images