From 824c95e4143ee348d75483a14d0d98882795b82d Mon Sep 17 00:00:00 2001 From: ashubawork Date: Wed, 30 Jul 2025 10:07:01 +0300 Subject: [PATCH] - fix block restrictions 3rd party plugin --- assets/js/admin/block-restrictions.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/assets/js/admin/block-restrictions.js b/assets/js/admin/block-restrictions.js index 04067f60..64f66ef9 100644 --- a/assets/js/admin/block-restrictions.js +++ b/assets/js/admin/block-restrictions.js @@ -9,6 +9,19 @@ function um_admin_blocks_custom_fields( um_condition_fields, props ) { return wp.hooks.applyFilters( 'um_admin_blocks_custom_fields', [], um_condition_fields, props ); } function um_add_restriction_attributes( settings, name ) { + // Some blocks have a strict attribute scheme. + // They reject any attributes that were not originally defined in them. + // When the editor tries to render such a block, the server sees an unfamiliar + // attribute um_is_restrict and returns a 400 error, prohibiting "foreign" properties. + const excludedPrefixes = [ + 'llms/' + ]; + + // Check the blocklist of prefixes. + if ( excludedPrefixes.some( prefix => name.startsWith( prefix ) ) ) { + return settings; + } + // add attributes for all blocks const restrictionAttributes = { um_is_restrict: {