Make WordPress Core

Changeset 25472


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

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

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

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

    r25307 r25472  
    113113 * @deprecated 2.9.0
    114114 * @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.
    115  * 
     115 *
    116116 * @param string $file Filesystem path relative to the wp-content directory.
    117117 * @return string Full filesystem path to edit.
     
    10521052 */
    10531053function wp_nav_menu_locations_meta_box() {
    1054     _deprecated_function( __FUNCTION__, '3.6' );   
     1054    _deprecated_function( __FUNCTION__, '3.6' );
    10551055}
    10561056
     
    11171117    return $upgrader->upgrade($theme);
    11181118}
     1119
     1120/**
     1121 * This was once used to display attachment links. Now it is deprecated and stubbed.
     1122 *
     1123 * {@internal Missing Short Description}}
     1124 *
     1125 * @since 2.0.0
     1126 * @deprecated 3.7.0
     1127 *
     1128 * @param unknown_type $id
     1129 * @return unknown
     1130 */
     1131function the_attachment_links( $id = false ) {
     1132    _deprecated_function( __FUNCTION__, '3.7' );
     1133}
  • 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.