Changeset 25472 for trunk/src/wp-admin/includes/template.php
- Timestamp:
- 09/17/2013 09:07:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r25240 r25472 694 694 return false; 695 695 } 696 }697 698 /**699 * {@internal Missing Short Description}}700 *701 * @since 2.0.0702 *703 * @param unknown_type $id704 * @return unknown705 */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 <?php747 696 } 748 697
Note: See TracChangeset
for help on using the changeset viewer.