Open IvanPr opened 1 year ago
To do something like this you need javascript. Something like:
function simulateMouseEvent(element, eventType) {
const event = new MouseEvent(eventType, {
bubbles: true,
});
element.dispatchEvent(event);
}
var initializeBlock = function( $block ) {
var panel = document.querySelector('.block-editor-block-inspector__advanced:not(.is-opened) button');
if( panel ) {
simulateMouseEvent(panel, 'click');
}
}
if( window.acf ) {
window.acf.addAction( 'render_block_preview', initializeBlock );
}
Is there a way to force open the 'Advanced' components-panel section of the ACF Block. Perhaps there could be a way to set initialOpen via block.json?