doAction( “area_wrap” )

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Actions
  6. doAction( “area_wrap” )
doAction( "area_wrap", $areaWrap, area );
doAction( "area_wrap_{key}", $areaWrap, area );

Fires when the outer wrap of an area was set up, but before the Area is displayed.

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

Params

$areaWrap
(jQuery, required) The area wrapper element which contains the Divi Area.
area
(DiviAreaItem, required) The area object.

Examples

// Add a custom class to the area wrapper.
DiviArea.addAction( 'area_wrap', function( areaWrap, area ) {
    areaWrap.addClass( 'demo-area-wrap' );
});

Notes

This action is fired before the init_area action.

Was this article helpful?

Related Articles