WordPress at a glance

get_post_galleries_images() WP 1.0

Retrieve the image srcs from galleries from a post's content, if present

Works based on: get_post_galleries()
✈ 1 time = 0.009545s = very slow | 50000 times = 595.55s = extremely slow | PHP 7.0.4, WP 4.4.2

No Hooks.

Return

Array. A list of lists, each containing image srcs parsed. from an expanded shortcode

Usage

get_post_galleries_images( $post );
$post(int/WP_Post)
Post ID or WP_Post object.
Default: global $post

Notes

  • See: get_post_galleries()

Changelog

Since 3.6.0 Introduced.

Code of get post galleries images: wp-includes/media.php WP 5.2.4

<?php
function get_post_galleries_images( $post = 0 ) {
	$galleries = get_post_galleries( $post, false );
	return wp_list_pluck( $galleries, 'src' );
}

Related Functions

From tag: Gallery

No comments
    Hello, !     Log In . Register