-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIHook.php
57 lines (51 loc) · 1.37 KB
/
IHook.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace Themosis\Hook;
interface IHook
{
/**
* Add event using the WordPress hooks.
*
* @param string|array $hooks The hook name.
* @param \Closure|string|array $callback Using a class method like so "MyClass@method"
* @param int $priority
* @param int $accepted_args
*
* @return mixed
*/
public function add($hooks, $callback, $priority = 10, $accepted_args = 2);
/**
* Run all events registered with the hook.
*
* @param string $hook The event hook name.
* @param mixed $args
*
* @return mixed
*/
public function run($hook, $args = null);
/**
* Check if a registered hook exists.
*
* @param string $hook
*
* @return bool
*/
public function exists($hook);
/**
* Return the callback registered with the given hook.
*
* @param string $hook The hook name.
*
* @return array|bool
*/
public function getCallback($hook);
/**
* Remove a defined action or filter.
*
* @param string $hook The hook name.
* @param int $priority The priority number.
* @param \Closure|string $callback The callback to remove.
*
* @return mixed
*/
public function remove($hook, $priority = 10, $callback = null);
}