2023-12-08 23:23:11 +00:00
|
|
|
<?php
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Handler class.
|
|
|
|
*
|
|
|
|
* @package Activitypub
|
|
|
|
*/
|
|
|
|
|
2023-12-08 23:23:11 +00:00
|
|
|
namespace Activitypub;
|
|
|
|
|
2024-06-27 12:10:38 +00:00
|
|
|
use Activitypub\Handler\Announce;
|
2023-12-08 23:23:11 +00:00
|
|
|
use Activitypub\Handler\Create;
|
|
|
|
use Activitypub\Handler\Delete;
|
|
|
|
use Activitypub\Handler\Follow;
|
2024-10-09 12:44:17 +00:00
|
|
|
use Activitypub\Handler\Like;
|
2023-12-08 23:23:11 +00:00
|
|
|
use Activitypub\Handler\Undo;
|
|
|
|
use Activitypub\Handler\Update;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handler class.
|
|
|
|
*/
|
|
|
|
class Handler {
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Initialize the class, registering WordPress hooks.
|
2023-12-08 23:23:11 +00:00
|
|
|
*/
|
|
|
|
public static function init() {
|
|
|
|
self::register_handlers();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register handlers.
|
|
|
|
*/
|
|
|
|
public static function register_handlers() {
|
2024-06-27 12:10:38 +00:00
|
|
|
Announce::init();
|
2023-12-08 23:23:11 +00:00
|
|
|
Create::init();
|
|
|
|
Delete::init();
|
|
|
|
Follow::init();
|
|
|
|
Undo::init();
|
|
|
|
Update::init();
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
if ( ! ACTIVITYPUB_DISABLE_REACTIONS ) {
|
|
|
|
Like::init();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register additional handlers.
|
|
|
|
*
|
|
|
|
* @since 1.3.0
|
|
|
|
*/
|
2023-12-08 23:23:11 +00:00
|
|
|
do_action( 'activitypub_register_handlers' );
|
|
|
|
}
|
|
|
|
}
|