| 1 |
<?php |
| 2 |
namespace Activitypub; |
| 3 |
|
| 4 |
use Activitypub\Handler\Announce; |
| 5 |
use Activitypub\Handler\Create; |
| 6 |
use Activitypub\Handler\Delete; |
| 7 |
use Activitypub\Handler\Follow; |
| 8 |
use Activitypub\Handler\Like; |
| 9 |
use Activitypub\Handler\Undo; |
| 10 |
use Activitypub\Handler\Update; |
| 11 |
|
| 12 |
/** |
| 13 |
* Handler class. |
| 14 |
*/ |
| 15 |
class Handler { |
| 16 |
/** |
| 17 |
* Initialize the class, registering WordPress hooks |
| 18 |
*/ |
| 19 |
public static function init() { |
| 20 |
self::register_handlers(); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Register handlers. |
| 25 |
*/ |
| 26 |
public static function register_handlers() { |
| 27 |
Announce::init(); |
| 28 |
Create::init(); |
| 29 |
Delete::init(); |
| 30 |
Follow::init(); |
| 31 |
Undo::init(); |
| 32 |
Update::init(); |
| 33 |
|
| 34 |
if ( ! ACTIVITYPUB_DISABLE_REACTIONS ) { |
| 35 |
Like::init(); |
| 36 |
} |
| 37 |
|
| 38 |
do_action( 'activitypub_register_handlers' ); |
| 39 |
} |
| 40 |
} |
| 41 |
|