get__id(); $actor = object_to_uri( $activity['actor'] ); $state = Followers::remove_follower( $user_id, $actor ); } // Handle "Undo" requests for "Like" and "Create" activities. if ( in_array( $type, array( 'Like', 'Create', 'Announce' ), true ) ) { if ( ACTIVITYPUB_DISABLE_INCOMING_INTERACTIONS ) { return; } $object_id = object_to_uri( $activity['object'] ); $comment = Comment::object_id_to_comment( esc_url_raw( $object_id ) ); if ( empty( $comment ) ) { return; } $state = wp_delete_comment( $comment, true ); } /** * Fires after an "Undo" activity has been handled. * * @param array $activity The JSON "Undo" Activity. * @param int|null $user_id The ID of the user who initiated the "Undo" activity otherwise null. * @param mixed $state The state of the "Undo" activity. */ do_action( 'activitypub_handled_undo', $activity, $user_id, $state ); } }