blocks/expanded_editor_overlay_class


目录

Customize the CSS class on the Expanded Editor modal overlay.

Description

This JavaScript filter allows you to modify the CSS class applied to the Expanded Editor modal overlay in ACF Blocks V3. This is useful for applying custom styling to the overlay.

Parameters

acf.addFilter( 'blocks/expanded_editor_overlay_class', function( className, block ) {
    return className;
});

className (string) The CSS class name for the overlay. Default: 'acf-expanded-editor-overlay'

block (object) The block object containing block data and attributes.

Example

Add a custom class to the overlay

acf.addFilter( 'blocks/expanded_editor_overlay_class', function( className, block ) {
    return className + ' my-custom-overlay';
});

Apply different classes based on block name

acf.addFilter( 'blocks/expanded_editor_overlay_class', function( className, block ) {
    if ( block.name === 'acf/hero' ) {
        return className + ' hero-overlay';
    }
    return className;
});

Replace the class entirely

acf.addFilter( 'blocks/expanded_editor_overlay_class', function( className, block ) {
    return 'my-overlay-class';
});

Changelog

Notes


版本号 #1
由 壳壳虫 创建于 2026-08-29 15:44:03 UTC
由 壳壳虫 更新于 2026-08-29 15:44:03 UTC