mirror of
https://github.com/Automattic/wordpress-activitypub
synced 2024-10-18 20:23:31 +00:00
dabff80cc2
* 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>
40 lines
731 B
PHP
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' );
|
|
}
|
|
}
|