| 73 | | $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); |
| | 73 | if ( function_exists( 'get_post_gallery_images' ) ) : |
| | 74 | $galleries = get_post_galleries(); |
| | 75 | $images = isset( $galleries[0]['ids'] ) ? explode( ',', $galleries[0]['ids'] ) : false; |
| | 76 | else : |
| | 77 | $pattern = get_shortcode_regex(); |
| | 78 | preg_match( "/$pattern/s", get_the_content(), $match ); |
| | 79 | $atts = shortcode_parse_atts( $match[3] ); |
| | 80 | $images = isset( $atts['ids'] ) ? explode( ',', $atts['ids'] ) : false; |
| | 81 | |
| | 82 | if ( ! $images ) : |
| | 83 | $images = get_posts( array( |
| | 84 | 'fields' => 'ids', |
| | 85 | 'numberposts' => 999, |
| | 86 | 'order' => 'ASC', |
| | 87 | 'orderby' => 'menu_order', |
| | 88 | 'post_mime_type' => 'image', |
| | 89 | 'post_parent' => $post->ID, |
| | 90 | 'post_type' => 'attachment', |
| | 91 | ) ); |
| | 92 | endif; |
| | 93 | endif; |
| | 94 | |