36 | | $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); |
| 36 | if ( function_exists( 'get_post_gallery_images' ) ) : |
| 37 | $galleries = get_post_galleries(); |
| 38 | $images = isset( $galleries[0]['ids'] ) ? explode( ',', $galleries[0]['ids'] ) : false; |
| 39 | else : |
| 40 | $pattern = get_shortcode_regex(); |
| 41 | preg_match( "/$pattern/s", get_the_content(), $match ); |
| 42 | $atts = shortcode_parse_atts( $match[3] ); |
| 43 | $images = isset( $atts['ids'] ) ? explode( ',', $atts['ids'] ) : false; |
| 44 | |
| 45 | if ( ! $images ) : |
| 46 | $images = get_posts( array( |
| 47 | 'fields' => 'ids', |
| 48 | 'numberposts' => 999, |
| 49 | 'order' => 'ASC', |
| 50 | 'orderby' => 'menu_order', |
| 51 | 'post_mime_type' => 'image', |
| 52 | 'post_parent' => $post->ID, |
| 53 | 'post_type' => 'attachment', |
| 54 | ) ); |
| 55 | endif; |
| 56 | endif; |
| 57 | |