| 1 |
<?php |
| 2 |
/** |
| 3 |
* Handler class. |
| 4 |
* |
| 5 |
* @package Activitypub |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Activitypub; |
| 9 |
|
| 10 |
/** |
| 11 |
* Handler class. |
| 12 |
*/ |
| 13 |
class Handler { |
| 14 |
/** |
| 15 |
* Initialize the class, registering WordPress hooks. |
| 16 |
*/ |
| 17 |
public static function init() { |
| 18 |
self::register_handlers(); |
| 19 |
self::register_outbox_handlers(); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Register handlers. |
| 24 |
*/ |
| 25 |
public static function register_handlers() { |
| 26 |
Handler\Accept::init(); |
| 27 |
Handler\Announce::init(); |
| 28 |
Handler\Collection_Sync::init(); |
| 29 |
Handler\Create::init(); |
| 30 |
Handler\Delete::init(); |
| 31 |
Handler\Feature_Request::init(); |
| 32 |
Handler\Follow::init(); |
| 33 |
Handler\Like::init(); |
| 34 |
Handler\Move::init(); |
| 35 |
Handler\Quote_Request::init(); |
| 36 |
Handler\Reject::init(); |
| 37 |
Handler\Undo::init(); |
| 38 |
Handler\Update::init(); |
| 39 |
|
| 40 |
/** |
| 41 |
* Register additional handlers. |
| 42 |
* |
| 43 |
* @since 1.3.0 |
| 44 |
*/ |
| 45 |
\do_action( 'activitypub_register_handlers' ); |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* Register outbox handlers. |
| 50 |
*/ |
| 51 |
public static function register_outbox_handlers() { |
| 52 |
Handler\Outbox\Add::init(); |
| 53 |
Handler\Outbox\Announce::init(); |
| 54 |
Handler\Outbox\Arrive::init(); |
| 55 |
Handler\Outbox\Block::init(); |
| 56 |
Handler\Outbox\Create::init(); |
| 57 |
Handler\Outbox\Delete::init(); |
| 58 |
Handler\Outbox\Follow::init(); |
| 59 |
Handler\Outbox\Like::init(); |
| 60 |
Handler\Outbox\Remove::init(); |
| 61 |
Handler\Outbox\Undo::init(); |
| 62 |
Handler\Outbox\Update::init(); |
| 63 |
|
| 64 |
/** |
| 65 |
* Register additional outbox handlers. |
| 66 |
* |
| 67 |
* @since 8.1.0 |
| 68 |
*/ |
| 69 |
\do_action( 'activitypub_register_outbox_handlers' ); |
| 70 |
} |
| 71 |
} |
| 72 |
|