Merge pull request #123 from pfefferle/pfefferle-patch-1

Add missing `author_id` to actions and filters
This commit is contained in:
Matthias Pfefferle 2021-06-10 08:48:36 +02:00 committed by GitHub
commit bd6de83152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,12 +82,12 @@ $json->endpoints = array(
*/ */
// filter output // filter output
$json = \apply_filters( 'activitypub_json_author_array', $json ); $json = \apply_filters( 'activitypub_json_author_array', $json, $author_id );
/* /*
* Action triggerd prior to the ActivityPub profile being created and sent to the client * Action triggerd prior to the ActivityPub profile being created and sent to the client
*/ */
\do_action( 'activitypub_json_author_pre' ); \do_action( 'activitypub_json_author_pre', $author_id );
$options = 0; $options = 0;
// JSON_PRETTY_PRINT added in PHP 5.4 // JSON_PRETTY_PRINT added in PHP 5.4
@ -102,7 +102,7 @@ $options |= \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT;
* *
* @param int $options The current options flags * @param int $options The current options flags
*/ */
$options = \apply_filters( 'activitypub_json_author_options', $options ); $options = \apply_filters( 'activitypub_json_author_options', $options, $author_id );
\header( 'Content-Type: application/activity+json' ); \header( 'Content-Type: application/activity+json' );
echo \wp_json_encode( $json, $options ); echo \wp_json_encode( $json, $options );
@ -110,4 +110,4 @@ echo \wp_json_encode( $json, $options );
/* /*
* Action triggerd after the ActivityPub profile has been created and sent to the client * Action triggerd after the ActivityPub profile has been created and sent to the client
*/ */
\do_action( 'activitypub_json_author_post' ); \do_action( 'activitypub_json_author_post', $author_id );