Similar to #33386, don't use `guid` when retrieving URL for a cropped header image in the Customizer.
Props polevaultweb. Fixes #33319. Built from https://develop.svn.wordpress.org/trunk@34188 git-svn-id: http://core.svn.wordpress.org/trunk@34156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
80165bfc4a
commit
57d2420ae5
|
@ -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'];
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34179';
|
||||
$wp_version = '4.4-alpha-34188';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue