| 1 |
<?php |
| 2 |
namespace Imagify\EventManagement; |
| 3 |
|
| 4 |
/** |
| 5 |
* A Subscriber knows what specific WordPress events it wants to listen to. |
| 6 |
* |
| 7 |
* When an EventManager adds a Subscriber, it gets all the WordPress events that |
| 8 |
* it wants to listen to. It then adds the subscriber as a listener for each of them. |
| 9 |
* |
| 10 |
* @author Carl Alexander <[email protected]> |
| 11 |
*/ |
| 12 |
interface SubscriberInterface { |
| 13 |
/** |
| 14 |
* Returns an array of events that this subscriber wants to listen to. |
| 15 |
* |
| 16 |
* The array key is the event name. The value can be: |
| 17 |
* |
| 18 |
* * The method name |
| 19 |
* * An array with the method name and priority |
| 20 |
* * An array with the method name, priority and number of accepted arguments |
| 21 |
* |
| 22 |
* For instance: |
| 23 |
* |
| 24 |
* * array('hook_name' => 'method_name') |
| 25 |
* * array('hook_name' => array('method_name', $priority)) |
| 26 |
* * array('hook_name' => array('method_name', $priority, $accepted_args)) |
| 27 |
* * array('hook_name' => array(array('method_name_1', $priority_1, $accepted_args_1)), array('method_name_2', $priority_2, $accepted_args_2))) |
| 28 |
* |
| 29 |
* @return array |
| 30 |
*/ |
| 31 |
public static function get_subscribed_events(); |
| 32 |
} |
| 33 |
|