wordpress-activitypub/includes/class-handler.php
Jan Boddez dabff80cc2
Add like handler (#804)
* Update class-comment.php

* Initial attempt

* Register like handler

* Add support for undoing likes

* add support for announce

and copied basic comment_type support handling from the Webmention plugin

* fix merge issues

* remove C&P issues

* add missing phpdoc

* Disable Announces and Likes by default.

* set ACTIVITYPUB_DISABLE_REACTIONS to false

* refactorings

* fix escaping

* add default object type

* deduplicate code

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-08-16 12:55:16 +02:00

40 lines
731 B
PHP

<?php
namespace Activitypub;
use Activitypub\Handler\Announce;
use Activitypub\Handler\Create;
use Activitypub\Handler\Delete;
use Activitypub\Handler\Follow;
use Activitypub\Handler\Like;
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() {
Announce::init();
Create::init();
Delete::init();
Follow::init();
Undo::init();
Update::init();
if ( ! ACTIVITYPUB_DISABLE_REACTIONS ) {
Like::init();
}
do_action( 'activitypub_register_handlers' );
}
}