Skip to content

Commit 6b1cc5e

Browse files
authored
Merge branch 'develop' into add/original-image-storage
2 parents 7f6c987 + dd4899b commit 6b1cc5e

File tree

15 files changed

+49
-27
lines changed

15 files changed

+49
-27
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/css/cloudinary.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/css/src/components/_terms_order.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
}
4040

4141
&-type {
42-
width: 45%;
4342
display: inline-block;
4443
margin-right: 8px;
4544

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/js/block-editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/js/cloudinary.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/js/src/components/video.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const TransformationsToggle = ( props ) => {
7575
return (
7676
<PanelBody title={__( 'Transformations', 'cloudinary' )}>
7777
<ToggleControl
78-
label={__( 'Overwrite Transformations', 'cloudinary' )}
78+
label={__( 'Overwrite Global Transformations', 'cloudinary' )}
7979
checked={overwrite_transformations}
8080
onChange={( value ) => {
8181
setAttributes( {overwrite_transformations: value} );

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-sync.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public function get_signature( $attachment_id, $cached = true ) {
262262
if ( ! empty( $signatures[ $attachment_id ] ) && true === $cached ) {
263263
$return = $signatures[ $attachment_id ];
264264
} else {
265-
$signature = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['signature'], true );
265+
$signature = (array) $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['signature'], true );
266266
if ( empty( $signature ) ) {
267267
$signature = array();
268268
}
@@ -758,6 +758,10 @@ public function set_signature_item( $attachment_id, $type, $value = null ) {
758758
// Generate a new value based on generator.
759759
$value = $this->generate_type_signature( $type, $attachment_id );
760760
}
761+
// Ensure we have an array.
762+
if ( empty( $meta[ Sync::META_KEYS['cloudinary'] ][ Sync::META_KEYS['signature'] ] ) || ! is_array( $meta[ Sync::META_KEYS['cloudinary'] ][ Sync::META_KEYS['signature'] ] ) ) {
763+
$meta[ Sync::META_KEYS['cloudinary'] ][ Sync::META_KEYS['signature'] ] = array();
764+
}
761765
$meta[ Sync::META_KEYS['cloudinary'] ][ Sync::META_KEYS['signature'] ][ $type ] = $value;
762766
wp_update_attachment_metadata( $attachment_id, $meta );
763767
}

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/connect/class-api.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ function ( $item ) use ( $transformation_index ) {
228228
* @param string|null $public_id The Public ID to get a url for.
229229
* @param array $args Additional args.
230230
* @param array $size The WP Size array.
231+
* @param bool $clean Flag to produce a non variable size url.
231232
*
232233
* @return string
233234
*/
@@ -398,10 +399,11 @@ public function upload_large( $attachment_id, $args ) {
398399
* @param int $attachment_id Attachment ID to upload.
399400
* @param array $args Array of upload options.
400401
* @param array $headers Additional headers to use in upload.
402+
* @param bool $try_remote Flag to try_remote upload.
401403
*
402404
* @return array|\WP_Error
403405
*/
404-
public function upload( $attachment_id, $args, $headers = array() ) {
406+
public function upload( $attachment_id, $args, $headers = array(), $try_remote = true ) {
405407

406408
$resource = ! empty( $args['resource_type'] ) ? $args['resource_type'] : 'image';
407409
$resource = $this->convert_resource_type( $resource );
@@ -416,7 +418,7 @@ public function upload( $attachment_id, $args, $headers = array() ) {
416418
$disable_https_fetch = false;
417419
}
418420
// Check if we can try http file upload.
419-
if ( empty( $headers ) && empty( $disable_https_fetch ) ) {
421+
if ( empty( $headers ) && empty( $disable_https_fetch ) && true === $try_remote ) {
420422
$args['file'] = $file_url;
421423
} else {
422424
// We should have the file in args at this point, but if the transient was set, it will be defaulting here.

0 commit comments

Comments
 (0)