diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 1b2ac2e281..2335c7b63a 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -893,7 +893,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> // Update the attachment $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' ) ); // Cleanup. @@ -1125,7 +1125,6 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> $object = array( 'ID' => $parent_attachment_id, 'post_title' => basename($cropped), - 'post_content' => $url, 'post_mime_type' => $image_type, 'guid' => $url, '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 ); $object['attachment_id'] = $new_attachment_id; + $object['url'] = wp_get_attachment_url( $new_attachment_id );; $object['width'] = $dimensions['dst_width']; $object['height'] = $dimensions['dst_height']; diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index ce75e4b5f6..35f6a7bba7 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -2413,7 +2413,7 @@ * @param {object} croppedImage Cropped attachment data. */ onCropped: function(croppedImage) { - var url = croppedImage.post_content, + var url = croppedImage.url, attachmentId = croppedImage.attachment_id, w = croppedImage.width, h = croppedImage.height;