applyFilters( “init_options” )

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Filters
  6. applyFilters( “init_options” )
applyFilters( 'init_options', options );

Filters the initial JS options while preparing the JS API. The options object is fully initialized and sanitized.

Params

options
(object) The sanitized and fully populated DiviAreaConfig object.

Examples

// Change the default fade-in and fade-out speed of Popups.
DiviArea.addFilter( 'init_options', function( options ) {
    // Slow down the animation to 1 second.
    options.animateSpeed = 1000;

    return options;
}); 

Notes

In most cases you can initialize the plugin options by directly accessing the DiviAreaConfig object like this:

<script>
// Same effect as the example above: Slow down animation to 1 second.
DiviAreaConfig.animateSpeed = 1000;
</script>

Was this article helpful?

Related Articles