Make WordPress Core


Ignore:
Timestamp:
09/17/2013 09:07:12 AM (13 years ago)
Author:
SergeyBiryukov
Message:

Deprecate the_attachment_links(), unused since [6910]. props vinod dalvi. fixes #25340.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r25240 r25472  
    694694                return false;
    695695        }
    696 }
    697 
    698 /**
    699  * {@internal Missing Short Description}}
    700  *
    701  * @since 2.0.0
    702  *
    703  * @param unknown_type $id
    704  * @return unknown
    705  */
    706 function the_attachment_links( $id = false ) {
    707         $id = (int) $id;
    708         $post = get_post( $id );
    709 
    710         if ( $post->post_type != 'attachment' )
    711                 return false;
    712 
    713         $icon = wp_get_attachment_image( $post->ID, 'thumbnail', true );
    714         $attachment_data = wp_get_attachment_metadata( $id );
    715         $thumb = isset( $attachment_data['thumb'] );
    716 ?>
    717 <form id="the-attachment-links">
    718 <table>
    719         <col />
    720         <col class="widefat" />
    721         <tr>
    722                 <th scope="row"><?php _e( 'URL' ) ?></th>
    723                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo esc_textarea( wp_get_attachment_url() ); ?></textarea></td>
    724         </tr>
    725 <?php if ( $icon ) : ?>
    726         <tr>
    727                 <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to file' ) : _e( 'Image linked to file' ); ?></th>
    728                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $icon ?></a></textarea></td>
    729         </tr>
    730         <tr>
    731                 <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to page' ); ?></th>
    732                 <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>
    733         </tr>
    734 <?php else : ?>
    735         <tr>
    736                 <th scope="row"><?php _e( 'Link to file' ) ?></th>
    737                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() ); ?></a></textarea></td>
    738         </tr>
    739         <tr>
    740                 <th scope="row"><?php _e( 'Link to page' ) ?></th>
    741                 <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>
    742         </tr>
    743 <?php endif; ?>
    744 </table>
    745 </form>
    746 <?php
    747696}
    748697
Note: See TracChangeset for help on using the changeset viewer.