| 1 |
<?php |
| 2 |
namespace Averta\WordPress\Event; |
| 3 |
|
| 4 |
|
| 5 |
interface HookInterface |
| 6 |
{ |
| 7 |
/** |
| 8 |
* Adds a callback function to a hook. |
| 9 |
* |
| 10 |
* @param string $hook_name |
| 11 |
* @param callable $callback |
| 12 |
* @param int $priority |
| 13 |
* @param int $accepted_args |
| 14 |
* |
| 15 |
* @return mixed |
| 16 |
*/ |
| 17 |
public function add( $hook_name, $callback, $priority = 10, $accepted_args = 1 ); |
| 18 |
|
| 19 |
/** |
| 20 |
* Removes a callback function from a hook. |
| 21 |
* |
| 22 |
* @param string $hook_name |
| 23 |
* @param callable $callback |
| 24 |
* @param int $priority |
| 25 |
* |
| 26 |
* @return mixed |
| 27 |
*/ |
| 28 |
public function remove( $hook_name, $callback, $priority = 10 ); |
| 29 |
|
| 30 |
/** |
| 31 |
* Checks if any action has been registered for a hook. |
| 32 |
* |
| 33 |
* @param string $hook_name |
| 34 |
* @param callable|bool $callback |
| 35 |
* |
| 36 |
* @return mixed |
| 37 |
*/ |
| 38 |
public function has( $hook_name, $callback = false ); |
| 39 |
|
| 40 |
/** |
| 41 |
* Retrieves the number of times an hook-event has been fired during the current request. |
| 42 |
* |
| 43 |
* @param string $hook_name |
| 44 |
* |
| 45 |
* @return mixed |
| 46 |
*/ |
| 47 |
public function did( $hook_name ); |
| 48 |
} |
| 49 |
|