Changeset 40070 for trunk/src/wp-includes/media.php
- Timestamp:
- 02/17/2017 06:45:31 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/media.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r39638 r40070 3682 3682 $srcs = array(); 3683 3683 3684 $shortcode_attrs = shortcode_parse_atts( $shortcode[3] ); 3685 if ( ! is_array( $shortcode_attrs ) ) { 3686 $shortcode_attrs = array(); 3687 } 3688 3689 // Specify the post id of the gallery we're viewing if the shortcode doesn't reference another post already. 3690 if ( ! isset( $shortcode_attrs['id'] ) ) { 3691 $shortcode[3] .= ' id="' . intval( $post->ID ) . '"'; 3692 } 3693 3684 3694 $gallery = do_shortcode_tag( $shortcode ); 3685 3695 if ( $html ) { … … 3688 3698 preg_match_all( '#src=([\'"])(.+?)\1#is', $gallery, $src, PREG_SET_ORDER ); 3689 3699 if ( ! empty( $src ) ) { 3690 foreach ( $src as $s ) 3700 foreach ( $src as $s ) { 3691 3701 $srcs[] = $s[2]; 3702 } 3692 3703 } 3693 3704 3694 $data = shortcode_parse_atts( $shortcode[3] ); 3695 $data['src'] = array_values( array_unique( $srcs ) ); 3696 $galleries[] = $data; 3705 $galleries[] = array_merge( 3706 $shortcode_attrs, 3707 array( 3708 'src' => array_values( array_unique( $srcs ) ) 3709 ) 3710 ); 3697 3711 } 3698 3712 }
Note: See TracChangeset
for help on using the changeset viewer.