2020-04-07 13:03:04 +00:00
|
|
|
<?php
|
2022-12-19 23:08:11 +00:00
|
|
|
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
2020-04-07 13:03:04 +00:00
|
|
|
$post = \get_post();
|
|
|
|
|
2024-02-08 12:31:25 +00:00
|
|
|
$post_object = \Activitypub\Transformer\Factory::get_transformer( $post )->to_object();
|
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_post_pre' );
|
|
|
|
|
|
|
|
\header( 'Content-Type: application/activity+json' );
|
2024-02-08 12:31:25 +00:00
|
|
|
echo $post_object->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_post_post' );
|