| Server IP : 54.36.91.62 / Your IP : 216.73.216.15 Web Server : Apache System : Linux webm021.cluster127.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : uxhactp ( 169076) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/uxhactp/www/wp-content/themes/astra/inc/assets/js/ |
Upload File : |
const updatingBlock = ['core/group'];
wp.hooks.addFilter(
'blocks.registerBlockType',
'astra/meta/groupLayoutSettings',
(settings, name) => {
if (!updatingBlock.includes(name)) {
return settings;
}
const newSettings = {
...settings,
supports: {
...(settings.supports || {}),
layout: {
...(settings.supports.layout || {}),
allowEditing: true,
allowSwitching: false,
allowInheriting: true,
},
__experimentalLayout: {
...(settings.supports.__experimentalLayout || {}),
allowEditing: true,
allowSwitching: false,
allowInheriting: true,
},
},
};
return newSettings;
},
20
);
wp.hooks.addFilter(
'blocks.getBlockAttributes',
'astra/groupBlockSetting/checkInheritOption',
(attributes, blockType) => {
if (!updatingBlock.includes(blockType.name)) {
return attributes;
}
if (blockType.name == 'core/group' && undefined != attributes.layout && 'flex' === attributes.layout.type) {
return attributes;
}
if (blockType.name == 'core/group' && undefined != attributes.layout && false == attributes.layout.inherit ) {
return attributes;
}
attributes = {
...attributes,
layout: {
inherit: true,
},
};
return attributes;
}
);
/**
* Set "Inherit default layout" option enable by default for Group block.
*
* Also set "Full Width" layout by default on drag-drop for following blocks.
*/
wp.blocks.registerBlockVariation(
'core/group',
{
isDefault: true,
attributes: {
layout: {
inherit: true,
},
align: 'full'
},
}
);
wp.blocks.registerBlockVariation(
'core/cover',
{
isDefault: true,
attributes: {
align: 'full'
},
}
);