$hooks API variable / WireHooks class

WireHooks located in file /wire/core/WireHooks.php

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon.

Show $var?             Show args?        

Common

NameReturnSummary 
$hooks->addHook(Wire $object, $method, $toObject)
stringHook a function/method to a hookable method call in this object 
$hooks->allowPathHooks()
boolGet or set whether path hooks are allowed 
$hooks->className()
string@return string 
$hooks->filterHooks(array $hooks, string $property, $value)
arrayFilter and return hooks matching given property and value 
$hooks->filterPathHooks(string $requestPath)
array boolReturn path hooks that have potential to match given request path 
$hooks->getAllLocalHooks()
arrayReturn the "all local hooks" cache 
$hooks->getAllPathHooks()
arrayReturn all pending path hooks 
$hooks->getClassParents($object)
arrayGet an array of parent classes and interfaces for the given object 
$hooks->getHooks(Wire $object)
arrayReturn all hooks associated with $object or method (if specified) 
$hooks->getPathHookRedirect()
stringReturn redirect URL required by an applicable path hook, or blank otherwise 
$hooks->hasHook(Wire $object, string $method)
boolSimilar to isHooked(), returns true if the method or property hooked, false if it isn't. 
$hooks->hasPathHooks()
boolReturn whether or not any path hooks are pending 
$hooks->isHooked(string $method)
boolReturns true if the method/property hooked, false if it isn't. 
$hooks->isMethodHooked($class, string $method)
boolSimilar to isHooked() method but also checks parent classes for the hooked method as well 
$hooks->isPropertyHooked($class, string $property)
boolSimilar to isHooked() method but also checks parent classes for the hooked property as well 
$hooks->removeHook(Wire $object, $hookID)
WireGiven a Hook ID provided by addHook() this removes the hook 
$hooks->runHooks(Wire $object, string $method, array $arguments)
arrayProvides the implementation for calling hooks in ProcessWire 

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #522
    In the 522nd issue of ProcessWire Weekly we'll check out the latest core updates, introduce a new module called File Mover, and more. Read on!
    Weekly.pw / 11 May 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.