doAction( "before_hide_area" )

doAction( "before_hide_area", area, hideAreas );
doAction( "before_hide_area_{key}", area, hideAreas );

Fires before an Area is hidden. The second parameter notifies the callback about Areas that will also be hidden together with this Area.

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


(DiviAreaItem, required) The Area which will be hidden.
(array, required) List of Area IDs that will be hidden before the current Area is hidden.


// Save a Cookie/localStorage detail when an Area is closed.
DiviArea.addAction( 'before_hide_area', function( area, hideIds ) {
    var key = area.getKey() + '_state';
    DiviArea.Utils.setLocalData( key, 'closed' );


The hideAreas array is always empty, but you can manipulate it, if you want to hide/not hide certain Areas before the new Area is opened. It's present in the action for consistency with the before_show_area action.

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