Overview
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
- Added in version 6.8
Notes
- This is a JavaScript filter, not a PHP filter
- Use
acf.addFilter()to register the filter in your block editor scripts - The filter runs when the Expanded Editor modal is opened
- This filter only applies to ACF Blocks V3
Supercharge Your Website With Premium Features Using ACF PRO
Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.
Related
- Filters: acf/blocks/fields_to_open_in_expanded_editor
- Filters: acf/blocks/default_expanded_editor_button_text
- Filters: acf/register_block_type_args
- Filters: acf/update_value
- Filters: acf/blocks/default_block_version