WordPress at a glance

get_post_gallery_images() WP 1.0

Checks a post's content for galleries and return the image srcs for the first found gallery

Notes:

  • See: get_post_gallery()
Works based on: get_post_gallery()
✈ 1 time = 0.009867s = very slow | 50000 times = 544.97s = extreme slow PHP 7.0.4, WP 4.4.2

No Hooks.

Return

Array. A list of a gallery's image srcs in order.

Usage

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

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

<?php
function get_post_gallery_images( $post = 0 ) {
	$gallery = get_post_gallery( $post, false );
	return empty( $gallery['src'] ) ? array() : $gallery['src'];
}

Related Functions

From tag: Gallery

No comments
    Hello, !     Log In . Register