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.009545 sec (very slow) | 50000 times — 595.55 sec (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 5.7.1

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

From tag: Gallery

No comments
    Log In