| 1 |
<?php |
| 2 |
$user = \Activitypub\Collection\Users::get_by_id( \get_the_author_meta( 'ID' ) ); |
| 3 |
|
| 4 |
$user->set_context( |
| 5 |
\Activitypub\Activity\Activity::CONTEXT |
| 6 |
); |
| 7 |
|
| 8 |
/* |
| 9 |
* Action triggerd prior to the ActivityPub profile being created and sent to the client |
| 10 |
*/ |
| 11 |
\do_action( 'activitypub_json_author_pre', $user->get__id() ); |
| 12 |
|
| 13 |
\header( 'Content-Type: application/activity+json' ); |
| 14 |
echo $user->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 15 |
|
| 16 |
/* |
| 17 |
* Action triggerd after the ActivityPub profile has been created and sent to the client |
| 18 |
*/ |
| 19 |
\do_action( 'activitypub_json_author_post', $user->get__id() ); |
| 20 |
|