From 2ba05d95f78913ac4e0ef7eacf91911e07890a19 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Fri, 20 Aug 2021 11:56:38 -0300 Subject: [PATCH] Checks WP version before adopting blockProps --- src/views/gutenberg-blocks/tainacan-blocks/facets-list/edit.js | 2 +- src/views/gutenberg-blocks/tainacan-blocks/facets-list/save.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/gutenberg-blocks/tainacan-blocks/facets-list/edit.js b/src/views/gutenberg-blocks/tainacan-blocks/facets-list/edit.js index 1fc4d4ac9..c815cd2b0 100644 --- a/src/views/gutenberg-blocks/tainacan-blocks/facets-list/edit.js +++ b/src/views/gutenberg-blocks/tainacan-blocks/facets-list/edit.js @@ -44,7 +44,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie } = attributes; // Gets blocks props from hook - const blockProps = useBlockProps(); + const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps(); // Obtains block's client id to render it on save function setAttributes({ blockId: clientId }); diff --git a/src/views/gutenberg-blocks/tainacan-blocks/facets-list/save.js b/src/views/gutenberg-blocks/tainacan-blocks/facets-list/save.js index 698757c60..2565363b2 100644 --- a/src/views/gutenberg-blocks/tainacan-blocks/facets-list/save.js +++ b/src/views/gutenberg-blocks/tainacan-blocks/facets-list/save.js @@ -25,7 +25,7 @@ export default function({ attributes, className }) { } = attributes; // Gets attributes such as style, that are automatically added by the editor hook - const blockProps = useBlockProps.save(); + const blockProps = tainacan_blocks.wp_version < '5.6' ? { className: className } : useBlockProps.save(); return