PHP Интерфейс Themosis\Hook\IHook

Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
add ( string $hook, Closure | string $callback, integer $priority = 10, integer $accepted_args = 2 ) : mixed Add event using the WordPress hooks.
exists ( string $hook ) : boolean Check if a registered hook exists.
getCallback ( string $hook ) : array | boolean Return the callback registered with the given hook.
remove ( string $hook, integer $priority = 10, Closure | string $callback = null ) : mixed Remove a defined action or filter.
run ( string $hook, mixed $args = null ) : mixed Run all events registered with the hook.

Описание методов

add() публичный Метод

Add event using the WordPress hooks.
public add ( string $hook, Closure | string $callback, integer $priority = 10, integer $accepted_args = 2 ) : mixed
$hook string The hook name.
$callback Closure | string Using a class method like so "MyClass@method"
$priority integer
$accepted_args integer
Результат mixed

exists() публичный Метод

Check if a registered hook exists.
public exists ( string $hook ) : boolean
$hook string
Результат boolean

getCallback() публичный Метод

Return the callback registered with the given hook.
public getCallback ( string $hook ) : array | boolean
$hook string The hook name.
Результат array | boolean

remove() публичный Метод

Remove a defined action or filter.
public remove ( string $hook, integer $priority = 10, Closure | string $callback = null ) : mixed
$hook string The hook name.
$priority integer The priority number.
$callback Closure | string The callback to remove.
Результат mixed

run() публичный Метод

Run all events registered with the hook.
public run ( string $hook, mixed $args = null ) : mixed
$hook string The event hook name.
$args mixed
Результат mixed