| @@ -1,12 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Handler class. | |
| 4 | - * | |
| 5 | - * @package Activitypub | |
| 6 | - */ | |
| 2 | +namespace Activitypub; | |
| 7 | 3 | |
| 8 | -namespace Activitypub; | |
| 4 | +use Activitypub\Handler\Announce; | |
| 5 | +use Activitypub\Handler\Create; | |
| 6 | +use Activitypub\Handler\Delete; | |
| 7 | +use Activitypub\Handler\Follow; | |
| 8 | +use Activitypub\Handler\Undo; | |
| 9 | +use Activitypub\Handler\Update; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * Handler class. |
| 12 | 13 | */ |
| @@ -11,13 +12,12 @@ | ||
| 11 | 12 | * Handler class. |
| 12 | 13 | */ |
| 13 | 14 | class Handler { |
| 14 | 15 | /** |
| 15 | - * Initialize the class, registering WordPress hooks. | |
| 16 | + * Initialize the class, registering WordPress hooks | |
| 16 | 17 | */ |
| 17 | 18 | public static function init() { |
| 18 | 19 | self::register_handlers(); |
| 19 | - self::register_outbox_handlers(); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Register handlers. |
| @@ -22,50 +22,14 @@ | ||
| 22 | 22 | /** |
| 23 | 23 | * Register handlers. |
| 24 | 24 | */ |
| 25 | 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(); | |
| 26 | + Announce::init(); | |
| 27 | + Create::init(); | |
| 28 | + Delete::init(); | |
| 29 | + Follow::init(); | |
| 30 | + Undo::init(); | |
| 31 | + Update::init(); | |
| 39 | 32 | |
| 40 | - /** | |
| 41 | - * Register additional handlers. | |
| 42 | - * | |
| 43 | - * @since 1.3.0 | |
| 44 | - */ | |
| 45 | 33 | 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 | 34 | } |
| 71 | 35 | } |