Checks a post’s content for galleries and return the image srcs for the first found gallery.
Description
See also
Parameters
Source
// If present, use the image IDs from the JSON blob as canonical.
if ( ! empty( $ids ) ) {
foreach ( $ids as $id ) {
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |
Example
A simple example of how to append the raw image URLs to the content of any post or page that has at least one gallery.
This does not work if the gallery type is set to ‘slideshow’. It returns nothing. Removing type=”slideshow” from the gallery shortcode allows the images to be picked up by this function.