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

Built from https://develop.svn.wordpress.org/trunk@25472


git-svn-id: http://core.svn.wordpress.org/trunk@25393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-09-17 09:08:08 +00:00
parent 48f63d061d
commit 14db24911f
2 changed files with 17 additions and 53 deletions

View File

@ -112,7 +112,7 @@ function dropdown_link_categories( $default = 0 ) {
* @since 1.5.0
* @deprecated 2.9.0
* @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.
*
*
* @param string $file Filesystem path relative to the wp-content directory.
* @return string Full filesystem path to edit.
*/
@ -1051,7 +1051,7 @@ function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
* @deprecated 3.6.0
*/
function wp_nav_menu_locations_meta_box() {
_deprecated_function( __FUNCTION__, '3.6' );
_deprecated_function( __FUNCTION__, '3.6' );
}
/**
@ -1116,3 +1116,18 @@ function wp_update_theme($theme, $feedback = '') {
$upgrader = new Theme_Upgrader();
return $upgrader->upgrade($theme);
}
/**
* This was once used to display attachment links. Now it is deprecated and stubbed.
*
* {@internal Missing Short Description}}
*
* @since 2.0.0
* @deprecated 3.7.0
*
* @param unknown_type $id
* @return unknown
*/
function the_attachment_links( $id = false ) {
_deprecated_function( __FUNCTION__, '3.7' );
}

View File

@ -695,57 +695,6 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
}
}
/**
* {@internal Missing Short Description}}
*
* @since 2.0.0
*
* @param unknown_type $id
* @return unknown
*/
function the_attachment_links( $id = false ) {
$id = (int) $id;
$post = get_post( $id );
if ( $post->post_type != 'attachment' )
return false;
$icon = wp_get_attachment_image( $post->ID, 'thumbnail', true );
$attachment_data = wp_get_attachment_metadata( $id );
$thumb = isset( $attachment_data['thumb'] );
?>
<form id="the-attachment-links">
<table>
<col />
<col class="widefat" />
<tr>
<th scope="row"><?php _e( 'URL' ) ?></th>
<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo esc_textarea( wp_get_attachment_url() ); ?></textarea></td>
</tr>
<?php if ( $icon ) : ?>
<tr>
<th scope="row"><?php $thumb ? _e( 'Thumbnail linked to file' ) : _e( 'Image linked to file' ); ?></th>
<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>
</tr>
<tr>
<th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to page' ); ?></th>
<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>
</tr>
<?php else : ?>
<tr>
<th scope="row"><?php _e( 'Link to file' ) ?></th>
<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>
</tr>
<tr>
<th scope="row"><?php _e( 'Link to page' ) ?></th>
<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>
</tr>
<?php endif; ?>
</table>
</form>
<?php
}
/**
* Print out <option> html elements for role selectors
*