laipower/wp-content/upgrade-temp-backup/plugins/activitypub/templates/comment-json.php

24 lines
721 B
PHP
Raw Normal View History

2024-05-09 15:27:03 +00:00
<?php
2024-07-19 19:46:16 +00:00
$comment = \get_comment( \get_query_var( 'c', null ) ); // phpcs:ignore
$transformer = \Activitypub\Transformer\Factory::get_transformer( $comment );
if ( \is_wp_error( $transformer ) ) {
\wp_die(
\esc_html( $transformer->get_error_message() ),
404
);
}
2024-05-09 15:27:03 +00:00
/*
* Action triggerd prior to the ActivityPub profile being created and sent to the client
*/
\do_action( 'activitypub_json_comment_pre' );
\header( 'Content-Type: application/activity+json' );
2024-07-19 19:46:16 +00:00
echo $transformer->to_object()->to_json(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2024-05-09 15:27:03 +00:00
/*
* Action triggerd after the ActivityPub profile has been created and sent to the client
*/
2024-07-19 19:46:16 +00:00
\do_action( 'activitypub_json_comment_post' );