| 1 |
<?php |
| 2 |
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited |
| 3 |
$post = \get_post(); |
| 4 |
|
| 5 |
$post_object = \Activitypub\Transformer\Factory::get_transformer( $post )->to_object(); |
| 6 |
|
| 7 |
/* |
| 8 |
* Action triggerd prior to the ActivityPub profile being created and sent to the client |
| 9 |
*/ |
| 10 |
\do_action( 'activitypub_json_post_pre' ); |
| 11 |
|
| 12 |
\header( 'Content-Type: application/activity+json' ); |
| 13 |
echo $post_object->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 14 |
|
| 15 |
/* |
| 16 |
* Action triggerd after the ActivityPub profile has been created and sent to the client |
| 17 |
*/ |
| 18 |
\do_action( 'activitypub_json_post_post' ); |
| 19 |
|