Changeset 28584 for trunk/src/wp-includes/media.php
- Timestamp:
- 05/27/2014 10:54:45 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r28550 r28584 1903 1903 $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); 1904 1904 1905 foreach ( $attachments as $k => $attachment ) 1906 if ( $attachment->ID == $post->ID ) 1905 foreach ( $attachments as $k => $attachment ) { 1906 if ( $attachment->ID == $post->ID ) { 1907 1907 break; 1908 1909 $k = $prev ? $k - 1 : $k + 1; 1910 1911 $output = $attachment_id = null; 1912 if ( isset( $attachments[ $k ] ) ) { 1913 $attachment_id = $attachments[ $k ]->ID; 1914 $output = wp_get_attachment_link( $attachment_id, $size, true, false, $text ); 1908 } 1909 } 1910 1911 $output = ''; 1912 $attachment_id = 0; 1913 1914 if ( $attachments ) { 1915 $k = $prev ? $k - 1 : $k + 1; 1916 1917 if ( isset( $attachments[ $k ] ) ) { 1918 $attachment_id = $attachments[ $k ]->ID; 1919 $output = wp_get_attachment_link( $attachment_id, $size, true, false, $text ); 1920 } 1915 1921 } 1916 1922
Note: See TracChangeset
for help on using the changeset viewer.