WordPress at a glance

get_post_galleries_images() WP 1.0

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

  • See: get_post_galleries()
Works based on: get_post_galleries()
✈ 1 time = 0.009545s = very slow | 50000 times = 595.55s = extreme 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

Code of get_post_galleries_images: wp-includes/media.php VER 4.9.8

<?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