Media: Add link to the original image in the image properties if it was scaled or rotated after uploading.
Fixes #49290. Built from https://develop.svn.wordpress.org/trunk@47202 git-svn-id: http://core.svn.wordpress.org/trunk@47002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d1b39f784c
commit
aea25de893
|
@ -3391,6 +3391,17 @@ function attachment_submitbox_metadata() {
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! empty( $meta['original_image'] ) ) {
|
||||||
|
?>
|
||||||
|
<div class="misc-pub-section misc-pub-original-image">
|
||||||
|
<?php _e( 'Original image:' ); ?>
|
||||||
|
<a href="<?php echo esc_url( wp_get_original_image_url( $attachment_id ) ); ?>">
|
||||||
|
<?php echo esc_html( wp_basename( wp_get_original_image_path( $attachment_id ) ) ); ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -425,6 +425,11 @@ function wp_print_media_templates() {
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
|
<# if ( data.originalImageURL && data.originalImageName ) { #>
|
||||||
|
<?php _e( 'Original image:' ); ?>
|
||||||
|
<a href="{{ data.originalImageURL }}">{{data.originalImageName}}</a>
|
||||||
|
<# } #>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<# if ( data.fileLength && data.fileLengthHumanReadable ) { #>
|
<# if ( data.fileLength && data.fileLengthHumanReadable ) { #>
|
||||||
|
@ -616,6 +621,11 @@ function wp_print_media_templates() {
|
||||||
</div>
|
</div>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
|
<# if ( data.originalImageURL && data.originalImageName ) { #>
|
||||||
|
<?php _e( 'Original image:' ); ?>
|
||||||
|
<a href="{{ data.originalImageURL }}">{{data.originalImageName}}</a>
|
||||||
|
<# } #>
|
||||||
|
|
||||||
<# if ( data.can.save && data.sizes ) { #>
|
<# if ( data.can.save && data.sizes ) { #>
|
||||||
<a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a>
|
<a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
|
@ -3560,6 +3560,11 @@ function wp_prepare_attachment_for_js( $attachment ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 'image' === $type ) {
|
if ( 'image' === $type ) {
|
||||||
|
if ( ! empty( $meta['original_image'] ) ) {
|
||||||
|
$response['originalImageURL'] = wp_get_original_image_url( $attachment->ID );
|
||||||
|
$response['originalImageName'] = wp_basename( wp_get_original_image_path( $attachment->ID ) );
|
||||||
|
}
|
||||||
|
|
||||||
$sizes['full'] = array( 'url' => $attachment_url );
|
$sizes['full'] = array( 'url' => $attachment_url );
|
||||||
|
|
||||||
if ( isset( $meta['height'], $meta['width'] ) ) {
|
if ( isset( $meta['height'], $meta['width'] ) ) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-alpha-47201';
|
$wp_version = '5.4-alpha-47202';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue