Changeset 48496
- Timestamp:
- 07/16/2020 09:29:05 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r48454 r48496 2251 2251 $output = "\n"; 2252 2252 foreach ( $attachments as $att_id => $attachment ) { 2253 $output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n"; 2253 if ( ! empty( $atts['link'] ) ) { 2254 if ( 'none' === $atts['link'] ) { 2255 $output .= wp_get_attachment_image( $att_id, $atts['size'], false, $attr ); 2256 } else { 2257 $output .= wp_get_attachment_link( $att_id, $atts['size'], false ); 2258 } 2259 } else { 2260 $output .= wp_get_attachment_link( $att_id, $atts['size'], true ); 2261 } 2262 $output .= "\n"; 2254 2263 } 2255 2264 return $output; -
trunk/tests/phpunit/tests/media.php
r48454 r48496 2947 2947 $this->assertTrue( wp_image_file_matches_image_meta( $image_src, $image_meta ) ); 2948 2948 } 2949 2950 /** 2951 * @ticket 22101 2952 */ 2953 function test_gallery_shortcode_when_is_feed_true() { 2954 2955 $this->go_to( '/?feed=rss2' ); 2956 2957 // Default: Links to image attachment page url 2958 $actual = gallery_shortcode( 2959 array( 2960 'ids' => self::$large_id, 2961 ) 2962 ); 2963 $this->assertContains( '?attachment_id=', $actual ); 2964 2965 // File: Links to image file url 2966 $actual = gallery_shortcode( 2967 array( 2968 'ids' => self::$large_id, 2969 'link' => 'file', 2970 ) 2971 ); 2972 $this->assertTrue( 2 === substr_count( $actual, '.jpg' ) ); 2973 2974 // None: Does not link 2975 $actual = gallery_shortcode( 2976 array( 2977 'ids' => self::$large_id, 2978 'link' => 'none', 2979 ) 2980 ); 2981 $this->assertFalse( strpos( $actual, '<a ' ) ); 2982 } 2983 2949 2984 } 2950 2985
Note: See TracChangeset
for help on using the changeset viewer.