get_post_gallery_images

The timeline below displays how wordpress function get_post_gallery_images has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Checks a post's content for galleries and return the image srcs for the first found gallery.
 *
 * @since 3.6.0
 *
 * @see get_post_gallery()
 *
 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
 * @return string[] A list of a gallery's image srcs in order.
 */
function get_post_gallery_images($post = 0)
{
    $gallery = get_post_gallery($post, false);
    return empty($gallery['src']) ? array() : $gallery['src'];
}

WordPress Version: 5.4

/**
 * Checks a post's content for galleries and return the image srcs for the first found gallery
 *
 * @since 3.6.0
 *
 * @see get_post_gallery()
 *
 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
 * @return string[] A list of a gallery's image srcs in order.
 */
function get_post_gallery_images($post = 0)
{
    $gallery = get_post_gallery($post, false);
    return empty($gallery['src']) ? array() : $gallery['src'];
}

WordPress Version: 4.2

/**
 * Checks a post's content for galleries and return the image srcs for the first found gallery
 *
 * @since 3.6.0
 *
 * @see get_post_gallery()
 *
 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
 * @return array A list of a gallery's image srcs in order.
 */
function get_post_gallery_images($post = 0)
{
    $gallery = get_post_gallery($post, false);
    return empty($gallery['src']) ? array() : $gallery['src'];
}

WordPress Version: 4.0

/**
 * Check a post's content for galleries and return the image srcs for the first found gallery
 *
 * @since 3.6.0
 *
 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
 * @return array A list of a gallery's image srcs in order.
 */
function get_post_gallery_images($post = 0)
{
    $gallery = get_post_gallery($post, false);
    return empty($gallery['src']) ? array() : $gallery['src'];
}

WordPress Version: 3.7

/**
 * Check a post's content for galleries and return the image srcs for the first found gallery
 *
 * @since 3.6.0
 *
 * @param mixed $post Optional. Post ID or object.
 * @return array A list of a gallery's image srcs in order
 */
function get_post_gallery_images($post = 0)
{
    $gallery = get_post_gallery($post, false);
    return empty($gallery['src']) ? array() : $gallery['src'];
}