2023-11-30 10:43:48 +00:00
|
|
|
<?php
|
|
|
|
namespace Activitypub;
|
|
|
|
|
2024-05-02 08:13:34 +00:00
|
|
|
use Activitypub\Handler\Announce;
|
2023-11-30 10:43:48 +00:00
|
|
|
use Activitypub\Handler\Create;
|
|
|
|
use Activitypub\Handler\Delete;
|
|
|
|
use Activitypub\Handler\Follow;
|
2024-08-16 10:55:16 +00:00
|
|
|
use Activitypub\Handler\Like;
|
2023-11-30 10:43:48 +00:00
|
|
|
use Activitypub\Handler\Undo;
|
|
|
|
use Activitypub\Handler\Update;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handler class.
|
|
|
|
*/
|
|
|
|
class Handler {
|
|
|
|
/**
|
|
|
|
* Initialize the class, registering WordPress hooks
|
|
|
|
*/
|
|
|
|
public static function init() {
|
|
|
|
self::register_handlers();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register handlers.
|
|
|
|
*/
|
|
|
|
public static function register_handlers() {
|
2024-05-02 08:13:34 +00:00
|
|
|
Announce::init();
|
2023-11-30 10:43:48 +00:00
|
|
|
Create::init();
|
|
|
|
Delete::init();
|
|
|
|
Follow::init();
|
|
|
|
Undo::init();
|
|
|
|
Update::init();
|
|
|
|
|
2024-08-16 10:55:16 +00:00
|
|
|
if ( ! ACTIVITYPUB_DISABLE_REACTIONS ) {
|
|
|
|
Like::init();
|
|
|
|
}
|
|
|
|
|
2023-11-30 10:43:48 +00:00
|
|
|
do_action( 'activitypub_register_handlers' );
|
|
|
|
}
|
|
|
|
}
|