Similar to #33386, don't use `guid` when retrieving URL for a cropped header image in the Customizer.

Props polevaultweb.
Fixes #33319.


git-svn-id: https://develop.svn.wordpress.org/trunk@34188 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-15 14:45:59 +00:00
parent 87d6be5991
commit acbeef27b9
2 changed files with 3 additions and 3 deletions

View File

@ -893,7 +893,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
// Update the attachment // Update the attachment
$attachment_id = $this->insert_attachment( $object, $cropped ); $attachment_id = $this->insert_attachment( $object, $cropped );
$url = $object['guid']; $url = wp_get_attachment_url( $attachment_id );
$this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) ); $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
// Cleanup. // Cleanup.
@ -1125,7 +1125,6 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
$object = array( $object = array(
'ID' => $parent_attachment_id, 'ID' => $parent_attachment_id,
'post_title' => basename($cropped), 'post_title' => basename($cropped),
'post_content' => $url,
'post_mime_type' => $image_type, 'post_mime_type' => $image_type,
'guid' => $url, 'guid' => $url,
'context' => 'custom-header' 'context' => 'custom-header'
@ -1207,6 +1206,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
$new_attachment_id = $this->insert_attachment( $object, $cropped ); $new_attachment_id = $this->insert_attachment( $object, $cropped );
$object['attachment_id'] = $new_attachment_id; $object['attachment_id'] = $new_attachment_id;
$object['url'] = wp_get_attachment_url( $new_attachment_id );;
$object['width'] = $dimensions['dst_width']; $object['width'] = $dimensions['dst_width'];
$object['height'] = $dimensions['dst_height']; $object['height'] = $dimensions['dst_height'];

View File

@ -2413,7 +2413,7 @@
* @param {object} croppedImage Cropped attachment data. * @param {object} croppedImage Cropped attachment data.
*/ */
onCropped: function(croppedImage) { onCropped: function(croppedImage) {
var url = croppedImage.post_content, var url = croppedImage.url,
attachmentId = croppedImage.attachment_id, attachmentId = croppedImage.attachment_id,
w = croppedImage.width, w = croppedImage.width,
h = croppedImage.height; h = croppedImage.height;