doAction( "init_area" )

doAction( "init_area", area );
doAction( "init_area_{key}", area );

Fired right after an area was fully initialized and is ready to be displayed.

The dynamic part of the filter name is the sanitized Area key. See DiviAreaItem.theKey() for details.


(DiviAreaItem, required) The Area which was initialized.


// Output a console comment upon initializing an Area.
DiviArea.addAction( 'init_area', function( area ) {
    var areaKey = area.getKey();
    console.log( 'Area is ready:', key );

// Instantly display the Divi Area with the ID "safety-notice".
// Notice, how the ID "safety-notice" changes to "safety_notice" in the hook name!
DiviArea.addAction( 'init_area_safety_notice', function( area ) { 'safety-notice' );


At this stage, the Area is not visible. This is the earliest point when can display the area.

Though the Area is hidden, it's still in the DOM and can be accessed by other scripts for a short time. See details on the area_preparation_time filter for more information.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.