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_{id}', areaWrap, area );

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

The {id} part in the hook name is the sanitized area-ID (all lower case, dashes changed to underscores).

Params

areaWrap
(jQuery) The area wrapper element which contains the Divi Area.
area
(DiviAreaItem) The containing 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