| 1 |
<?php |
| 2 |
/** |
| 3 |
* Handler class. |
| 4 |
* |
| 5 |
* @package Activitypub |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Activitypub; |
| 9 |
|
| 10 |
use Activitypub\Handler\Accept; |
| 11 |
use Activitypub\Handler\Announce; |
| 12 |
use Activitypub\Handler\Create; |
| 13 |
use Activitypub\Handler\Delete; |
| 14 |
use Activitypub\Handler\Follow; |
| 15 |
use Activitypub\Handler\Like; |
| 16 |
use Activitypub\Handler\Move; |
| 17 |
use Activitypub\Handler\Reject; |
| 18 |
use Activitypub\Handler\Undo; |
| 19 |
use Activitypub\Handler\Update; |
| 20 |
|
| 21 |
/** |
| 22 |
* Handler class. |
| 23 |
*/ |
| 24 |
class Handler { |
| 25 |
/** |
| 26 |
* Initialize the class, registering WordPress hooks. |
| 27 |
*/ |
| 28 |
public static function init() { |
| 29 |
self::register_handlers(); |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Register handlers. |
| 34 |
*/ |
| 35 |
public static function register_handlers() { |
| 36 |
Accept::init(); |
| 37 |
Announce::init(); |
| 38 |
Create::init(); |
| 39 |
Delete::init(); |
| 40 |
Follow::init(); |
| 41 |
Like::init(); |
| 42 |
Move::init(); |
| 43 |
Reject::init(); |
| 44 |
Undo::init(); |
| 45 |
Update::init(); |
| 46 |
|
| 47 |
/** |
| 48 |
* Register additional handlers. |
| 49 |
* |
| 50 |
* @since 1.3.0 |
| 51 |
*/ |
| 52 |
do_action( 'activitypub_register_handlers' ); |
| 53 |
} |
| 54 |
} |
| 55 |
|