mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Post/Page Image was too generic a name. Post/Page Thumbnail is more clear, even if you can create very large thumbnail images if you so choose.
git-svn-id: https://develop.svn.wordpress.org/trunk@12351 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1062,32 +1062,32 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML for the post image meta-box.
|
||||
* Output HTML for the post thumbnail meta-box.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param int $thumbnail_id ID of the attachment used for thumbnail
|
||||
* @return string html
|
||||
*/
|
||||
function _wp_post_image_html( $thumbnail_id = NULL ) {
|
||||
function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
|
||||
global $content_width, $_wp_additional_image_sizes;
|
||||
$content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set image' ) . '</a></p>';
|
||||
$content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a></p>';
|
||||
|
||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
$old_content_width = $content_width;
|
||||
$content_width = 266;
|
||||
if ( !isset( $_wp_additional_image_sizes['post-image'] ) )
|
||||
if ( !isset( $_wp_additional_image_sizes['post-thumbnail'] ) )
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, array( $content_width, $content_width ) );
|
||||
else
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-image' );
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );
|
||||
if ( !empty( $thumbnail_html ) ) {
|
||||
$content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>';
|
||||
$content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove image' ) . '</a></p>';
|
||||
$content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove thumbnail' ) . '</a></p>';
|
||||
}
|
||||
$content_width = $old_content_width;
|
||||
}
|
||||
|
||||
return apply_filters( 'admin_post_image_html', $content );
|
||||
return apply_filters( 'admin_post_thumbnail_html', $content );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user