$hooksgetHooks()

Return all hooks associated with $object or method (if specified)

Usage

// basic usage
$array = $hooks->getHooks(Wire $object);

// usage with all arguments
$array = $hooks->getHooks(Wire $object, string $method = '', int $getHooks = 0);

Arguments

NameType(s)Description
$objectWire
$method (optional)string

Optional method that hooks will be limited to.

  • Or specify blank string to return all hooks for $object.
  • Or specify '*' to return all hooks for all objects ($object ignored so use NullPage). Note that this option is available when ProcessWire is in debug mode only.
$getHooks (optional)int

Get hooks of type, specify one of the following constants:

  • WireHooks::getHooksAll returns all hooks [0] (default)
  • WireHooks::getHooksLocal returns local hooks [1] only
  • WireHooks::getHooksStatic returns static hooks [2] only

Return value

array


$hooks methods and properties

API reference based on ProcessWire core version 3.0.257