'any' ) ); if ( $exists ) { return; } // If the object is a Create activity, extract the actual object from it. if ( isset( $activity['object']['type'] ) && 'Create' === $activity['object']['type'] ) { $activity['object'] = object_to_uri( $activity['object']['object'] ); } $success = false; $result = Interactions::add_reaction( $activity ); if ( $result && ! \is_wp_error( $result ) ) { $success = true; $result = \get_comment( $result ); } /** * Fires after an ActivityPub Announce activity has been handled. * * @param array $activity The ActivityPub activity data. * @param int[] $user_ids The local user IDs. * @param bool $success True on success, false otherwise. * @param array|string|int|\WP_Error|false $result The WP_Comment object of the created announce/repost comment, or null if creation failed. */ \do_action( 'activitypub_handled_announce', $activity, (array) $user_ids, $success, $result ); } }