$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 #519
    In the 519th issue of ProcessWire Weekly we'll check out a new third party module called RockForms, introduce the latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 20 April 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

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits