DiviAreaItem.addFilter()

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Functions
  6. DiviAreaItem.addFilter()
DiviAreaItem.addFilter(hook, callback, priority, context)

Register a new hook that only handles filters of this Area. Use DiviAreaItem.applyFilters() to apply an Area filter.

See DiviArea.addFilter() function for more details on how filters work.

Params

hook
(string, required) The hook name, without an area-suffix.
callback
(function, required) The callback function to execute when the filter is applied. The return value of the callback function defines the new (aka “filtered”) value.
priority
(int, optional) Used to specify the order, in which callbacks are executed. Callbacks with a lower priority are called first.
Default: 10
context
(object, optional) Used to define a custom value for the scope-variable this in the callback function.
Default: window

Returns

The function does not return anything.

Notes

No notes

Was this article helpful?

Related Articles