WordPress.org

Make WordPress Core

Changeset 4408


Ignore:
Timestamp:
10/19/06 00:37:10 (8 years ago)
Author:
markjaquith
Message:

Attachment link fixes from mdawaffe. fixes #3261

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r4405 r4408  
    123123 
    124124    $i = 0; 
    125     $search = "# id=(\"|')p(\d+)\\1#i"; 
     125    $search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i"; 
    126126    foreach ( $anchor_matches[0] as $anchor ) { 
    127127        if ( 0 == preg_match($search, $anchor, $id_matches) ) 
    128128            continue; 
    129129 
    130         $id = $id_matches[2]; 
     130        $id = $id_matches[3]; 
    131131 
    132132        // While we have the attachment ID, let's adopt any orphans. 
     
    20082008    <tr> 
    20092009        <th scope="row"><?php $thumb ? _e('Thumbnail linked to file') : _e('Image linked to file'); ?></th> 
    2010         <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> 
     2010        <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>"><?php echo $icon ?></a></textarea></td> 
    20112011    </tr> 
    20122012    <tr> 
    20132013        <th scope="row"><?php $thumb ? _e('Thumbnail linked to page') : _e('Image linked to file'); ?></th> 
    2014         <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> 
     2014        <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td> 
    20152015    </tr> 
    20162016<?php else : ?> 
     
    20212021    <tr> 
    20222022        <th scope="row"><?php _e('Link to page') ?></th> 
    2023         <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td> 
     2023        <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment wp-att-<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td> 
    20242024    </tr> 
    20252025<?php endif; ?> 
  • trunk/wp-admin/upload-js.php

    r4381 r4408  
    222222 
    223223            if ( 'none' != link ) 
    224                 h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment" ) ) + "' title='" + this.currentImage.title + "'>"; 
     224                h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment wp-att-" + this.currentImage.ID + "'" ) ) + "' title='" + this.currentImage.title + "'>"; 
    225225            if ( display ) 
    226226                h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />"; 
Note: See TracChangeset for help on using the changeset viewer.