Changeset 7222
- Timestamp:
- 03/11/2008 12:09:14 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r7218 r7222 339 339 } 340 340 341 function previous_image_link() { 342 adjacent_image_link(true); 343 } 344 345 function next_image_link() { 346 adjacent_image_link(false); 347 } 348 349 function adjacent_image_link($prev = true) { 350 global $post; 351 $post = get_post($post); 352 $attachments = array_values(get_children("post_parent=$post->post_parent&post_type=attachment&post_mime_type=image&orderby=\"menu_order ASC, ID ASC\"")); 353 354 foreach ( $attachments as $k => $attachment ) 355 if ( $attachment->ID == $post->ID ) 356 break; 357 358 $k = $prev ? $k - 1 : $k + 1; 359 360 if ( isset($attachments[$k]) ) 361 echo get_the_attachment_link($attachments[$k]->ID, true, array(128, 96), true); 362 } 363 341 364 ?>
Note: See TracChangeset
for help on using the changeset viewer.