laipower/wp-content/plugins/activitypub/templates/author-json.php

20 lines
617 B
PHP
Raw Normal View History

2020-04-07 13:03:04 +00:00
<?php
$user = \Activitypub\Collection\Users::get_by_id( \get_the_author_meta( 'ID' ) );
2020-04-07 13:03:04 +00:00
$user->set_context(
\Activitypub\Activity\Activity::CONTEXT
2020-04-07 13:03:04 +00:00
);
/*
* Action triggerd prior to the ActivityPub profile being created and sent to the client
*/
\do_action( 'activitypub_json_author_pre', $user->get__id() );
2020-04-07 13:03:04 +00:00
\header( 'Content-Type: application/activity+json' );
echo $user->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2020-04-07 13:03:04 +00:00
/*
* Action triggerd after the ActivityPub profile has been created and sent to the client
*/
\do_action( 'activitypub_json_author_post', $user->get__id() );