Retrieves the image srcs from galleries from a post’s content, if present.
Description
See also
Parameters
Source
}
$galleries = array();
if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER ) ) {
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |
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.