applyFilters( “get_option_{key}” )

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Filters
  6. applyFilters( “get_option_{key}” )
DiviArea.applyFilters( "get_option_{key}", value );

Filters an option that was read from the DiviAreaConfig object.

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

Params

value
(mixed) The option value to return.

Source

This filter is called inside DiviArea.Utils.getOption().

Examples

// Set animationSpeed via a hook.
// Note that the hook name is all lower case!
DiviArea.addFilter( 'get_option_animationspeed', function( value ) {
    return 1000; // Increase animationSpeed to 1000ms
});

Notes

The DiviAreaConfig object was formerly called DiviPopupData. Both objects can be used interchangeably when directly accessing the plugin configuration. When writing a new integration then “DiviAreaConfig” is the recommended name.

Was this article helpful?

Related Articles