Skip to content

Divi Builder JavaScript Hooks

Vintage

Source category: hooks Last updated: 2022-07-13

Layout

{module_type}.css.selector

Filters module selector on the rendered layout. This filter is fired before selector processing. Third-party extensions may use this filter to modify module CSS selector such as removing builder selector prefix, append child element class, etc.

Type: Filter Since: 4.0.0

ParamTypeDescription
selectorstringModule selector.
typestringModule slug.

Examples:


/**
 * Filters Hello World module selector after builder content is loaded.
 */
document.addEventListener('ETDOMContentLoaded', function() {
    // Module type: smpl_hello_world.
    wp.hooks.addFilter('smpl.hello.world.css.selector', 'smpl-setting-update', function(selector){
        // Processing Hello World module selector here ...
        return selector;
    });
});

{module_type}.processed.css.selector

Filters processed module selector on the rendered layout. This filter is fired after selector processing. Third-party extensions may use this filter to modify module CSS selector such as removing builder selector prefix, append child element class, etc.

Type: Filter Since: 4.17.6

ParamTypeDescription
selectorstringProcessed module selector.
typestringModule slug.

Examples:


/**
 * Filters Hello World module selector after builder content is loaded.
 */
document.addEventListener('ETDOMContentLoaded', function() {
    // Module type: smpl_hello_world.
    wp.hooks.addFilter('smpl.hello.world.processed.css.selector', 'smpl-setting-update', function(selector){
        // Processing Hello World module selector here ...
        return selector;
    });
});

Reference compiled from publicly available Divi developer documentation.