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