$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 #549
    In the 549th issue of ProcessWire Weekly we’re going to check out the latest core updates, highlight one older yet still very relevant third party module, and more. Read on!
    Weekly.pw / 17 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH