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