mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- fix block restrictions 3rd party plugin
This commit is contained in:
@@ -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 );
|
return wp.hooks.applyFilters( 'um_admin_blocks_custom_fields', [], um_condition_fields, props );
|
||||||
}
|
}
|
||||||
function um_add_restriction_attributes( settings, name ) {
|
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
|
// add attributes for all blocks
|
||||||
const restrictionAttributes = {
|
const restrictionAttributes = {
|
||||||
um_is_restrict: {
|
um_is_restrict: {
|
||||||
|
|||||||
Reference in New Issue
Block a user