PHP 인터페이스 Themosis\Hook\IHook

파일 보기 프로젝트 열기: themosis/framework 0 사용 예제들

공개 메소드들

메소드 설명
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