Make WordPress Core


Ignore:
Timestamp:
02/04/2009 03:12:24 PM (17 years ago)
Author:
azaozz
Message:

wp_get_attachment_link() variable upgrade, props noel, fixes #9036

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r10227 r10495  
    690690 *
    691691 * @since 2.5.0
    692  */
    693 function previous_image_link() {
    694     adjacent_image_link(true);
     692 * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string. 0 or 'none' will default to post_title or $text;
     693 * @param string $text Optional, default is false. If included, link will reflect $text variable.
     694 * @return string HTML content.
     695 */
     696function previous_image_link($size = 'thumbnail', $text = false) {
     697    adjacent_image_link(true, $size, $text);
    695698}
    696699
     
    699702 *
    700703 * @since 2.5.0
    701  */
    702 function next_image_link() {
    703     adjacent_image_link(false);
     704 * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string. 0 or 'none' will default to post_title or $text;
     705 * @param string $text Optional, default is false. If included, link will reflect $text variable.
     706 * @return string HTML content.
     707 */
     708function next_image_link($size = 'thumbnail', $text = false) {
     709    adjacent_image_link(false, $size, $text);
    704710}
    705711
     
    713719 * @param bool $prev Optional. Default is true to display previous link, true for next.
    714720 */
    715 function adjacent_image_link($prev = true) {
     721function adjacent_image_link($prev = true, $size = 'thumbnail', $text = false) {
    716722    global $post;
    717723    $post = get_post($post);
     
    725731
    726732    if ( isset($attachments[$k]) )
    727         echo wp_get_attachment_link($attachments[$k]->ID, 'thumbnail', true);
     733        echo wp_get_attachment_link($attachments[$k]->ID, $size, true, false, $text);
    728734}
    729735
Note: See TracChangeset for help on using the changeset viewer.