'any' ) ); if ( $exists ) { return; } $success = false; $result = Interactions::add_reaction( $like ); if ( $result && ! \is_wp_error( $result ) ) { $success = true; $result = \get_comment( $result ); } /** * Fires after an ActivityPub Like activity has been handled. * * @param array $like The ActivityPub activity data. * @param int[] $user_ids The local user IDs. * @param bool $success True on success, false otherwise. * @param array|false|int|string|\WP_Comment|\WP_Error $result The WP_Comment object of the created like comment, or null if creation failed. */ \do_action( 'activitypub_handled_like', $like, (array) $user_ids, $success, $result ); } /** * Set the object to the object ID. * * @param \Activitypub\Activity\Activity $activity The Activity object. * @return \Activitypub\Activity\Activity The filtered Activity object. */ public static function outbox_activity( $activity ) { if ( 'Like' === $activity->get_type() ) { $activity->set_object( object_to_uri( $activity->get_object() ) ); } return $activity; } }