Skip to content

Commit 79689d8

Browse files
Ensure compatibility with WP 5.6
1 parent 67e9a3d commit 79689d8

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== Cloudinary - Deliver Images and Videos at Scale ===
22
Contributors: Cloudinary, XWP, Automattic
33
Tags: image-optimizer, core-web-vitals, video, resize, performance
4-
Requires at least: 6.3
4+
Requires at least: 5.6
55
Tested up to: 7.0
66
Requires PHP: 7.4
77
Stable tag: STABLETAG

src/js/components/settings-gallery.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Dot from 'dot-object';
88
/**
99
* WordPress dependencies
1010
*/
11-
import { createRoot, useEffect, useState } from '@wordpress/element';
11+
import { createRoot, render, useEffect, useState } from '@wordpress/element';
1212

1313
/**
1414
* Internal dependencies
@@ -127,7 +127,9 @@ const StatefulGalleryControls = () => {
127127
);
128128
};
129129

130-
const root = createRoot(
131-
document.getElementById( 'app_gallery_gallery_config' )
132-
);
133-
root.render( <StatefulGalleryControls /> );
130+
const container = document.getElementById( 'app_gallery_gallery_config' );
131+
if ( createRoot ) {
132+
createRoot( container ).render( <StatefulGalleryControls /> );
133+
} else {
134+
render( <StatefulGalleryControls />, container );
135+
}

src/js/gallery-block/controls.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
214214
<Button
215215
key={ type.value + '-look-and-feel' }
216216
variant="secondary"
217+
isSecondary
217218
isPressed={
218219
type.value ===
219220
attributes.transformation_crop
@@ -251,6 +252,7 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
251252
<Button
252253
key={ navType.value + '-navigation' }
253254
variant="secondary"
255+
isSecondary
254256
isPressed={
255257
navType.value === attributes.navigation
256258
}
@@ -283,6 +285,7 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
283285
<Button
284286
key={ item.value + '-zoom-type' }
285287
variant="secondary"
288+
isSecondary
286289
isPressed={
287290
item.value ===
288291
attributes.zoomProps_type
@@ -331,6 +334,7 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
331334
'-zoom-trigger'
332335
}
333336
variant="secondary"
337+
isSecondary
334338
isPressed={
335339
item.value ===
336340
attributes.zoomProps_trigger
@@ -364,6 +368,7 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
364368
<Button
365369
key={ item.value + '-carousel-location' }
366370
variant="secondary"
371+
isSecondary
367372
isPressed={
368373
item.value === attributes.carouselLocation
369374
}
@@ -396,6 +401,7 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
396401
<Button
397402
key={ item.value + '-carousel-style' }
398403
variant="secondary"
404+
isSecondary
399405
isPressed={
400406
item.value === attributes.carouselStyle
401407
}
@@ -463,6 +469,7 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
463469
<Button
464470
key={ item.value + '-selected-style' }
465471
variant="secondary"
472+
isSecondary
466473
isPressed={
467474
item.value ===
468475
attributes.thumbnailProps_selectedStyle

src/js/gallery-block/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import save from './save';
1212
import attributes from './attributes.json';
1313

1414
registerBlockType( 'cloudinary/gallery', {
15-
apiVersion: 2,
1615
title: __( 'Cloudinary Gallery', 'cloudinary' ),
1716
description: __(
1817
'Add a gallery powered by the Cloudinary Gallery Widget to your post.',

0 commit comments

Comments
 (0)