Skip to content

Commit 15a665b

Browse files
authored
Merge pull request #199 from cloudinary/fix/transformation-checkbox-unclarity
Fix labels in post with clearer ones
2 parents 7ff62e5 + cce4991 commit 15a665b

File tree

10 files changed

+15
-13
lines changed

10 files changed

+15
-13
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/media/class-filter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ private function template_overwrite_insert() {
586586
return '<# if( data.attachment.attributes.transformations ) { #>
587587
<div class="setting cld-overwrite">
588588
<label>
589-
<span>' . esc_html__( 'Overwrite Transformations', 'cloudinary' ) . '</span>
589+
<span>' . esc_html__( 'Overwrite Global Transformations', 'cloudinary' ) . '</span>
590590
<input type="checkbox" data-setting="cldoverwrite" value="true"<# if ( data.model.cldoverwrite ) { #> checked="checked"<# } #> />
591591
</label>
592592
</div>
@@ -602,7 +602,7 @@ private function template_overwrite_insert_video() {
602602
return '<# if( \'video\' === data.type && data.attachment.attributes.transformations ) { #>
603603
<div class="setting cld-overwrite">
604604
<label>
605-
<span>' . esc_html__( 'Overwrite Transformations', 'cloudinary' ) . '</span>
605+
<span>' . esc_html__( 'Overwrite Global Transformations', 'cloudinary' ) . '</span>
606606
<input type="checkbox" data-setting="cldoverwrite" value="true"<# if ( data.model.cldoverwrite ) { #> checked="checked"<# } #> />
607607
</label>
608608
</div>
@@ -620,7 +620,7 @@ private function template_overwrite_edit() {
620620
<label>
621621
<span>&nbsp;</span>
622622
<input type="checkbox" data-setting="cldoverwrite" value="true" <# if ( data.model.cldoverwrite ) { #>checked="checked"<# } #> />
623-
' . esc_html__( 'Overwrite Transformations', 'cloudinary' ) . '
623+
' . esc_html__( 'Overwrite Global Transformations', 'cloudinary' ) . '
624624
</label>
625625
</div>
626626
<# } #>';
@@ -636,7 +636,7 @@ private function template_overwrite_video_edit() {
636636
<div class="setting cld-overwrite">
637637
<label>
638638
<input type="checkbox" data-setting="cldoverwrite" value="true" <# if ( data.model.cldoverwrite ) { #>checked="checked"<# } #> />
639-
' . esc_html__( 'Overwrite Transformations', 'cloudinary' ) . '
639+
' . esc_html__( 'Overwrite Global Transformations', 'cloudinary' ) . '
640640
</label>
641641
</div>
642642
<# } #>';

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/media/class-global-transformations.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,14 @@ private function init_taxonomy_manager( $post ) {
402402
}
403403
}
404404
$out[] = '</ul>';
405+
405406
// Get apply Type.
406-
$type = get_post_meta( $post->ID, self::META_APPLY_KEY . '_terms', true );
407-
$out[] = '<label class="cld-tax-order-list-type"><input ' . checked( 'overwrite', $type, false ) . ' type="checkbox" value="overwrite" name="cld_apply_type" />' . __( 'Overwrite', 'cloudinary' ) . '</label>';
407+
if ( ! empty( $terms ) ) {
408+
$type = get_post_meta( $post->ID, self::META_APPLY_KEY . '_terms', true );
409+
$out[] = '<label class="cld-tax-order-list-type"><input ' . checked( 'overwrite', $type, false ) . ' type="checkbox" value="overwrite" name="cld_apply_type" />' . __( 'Overwrite taxonomy', 'cloudinary' ) . '</label>';
410+
}
411+
408412
$out[] = '</div>';
409-
410413
return implode( $out );
411414
}
412415

@@ -501,7 +504,7 @@ public function classic_overwrite_transformations_featured_image( $content, $pos
501504
'<p><label for="%1$s"><input type="hidden" name="%1$s" value="0" /><input type="checkbox" name="%1$s" id="%1$s" value="1" %2$s /> %3$s</label></p>',
502505
esc_attr( self::META_FEATURED_IMAGE_KEY ),
503506
checked( $field_value, 1, false ),
504-
esc_html__( 'Overwrite Transformations', 'cloudinary' )
507+
esc_html__( 'Overwrite Global Transformations', 'cloudinary' )
505508
);
506509
}
507510

0 commit comments

Comments
 (0)