We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79b82bb commit 79d87b2Copy full SHA for 79d87b2
1 file changed
disable-comments.php
@@ -645,6 +645,21 @@ private function is_allowed_comment_type_request($request = null) {
645
}
646
647
648
+
649
+ // For DELETE requests, extract comment ID from the route path
650
+ // The comment ID is only in the URL (e.g., /wp/v2/comments/123), not in request params
651
+ if (!$comment_type && $request->is_method('DELETE')) {
652
+ $route_parts = explode('/', $request->get_route());
653
+ $comment_id = end($route_parts);
654
655
+ // Ensure we have a numeric comment ID
656
+ if (is_numeric($comment_id)) {
657
+ $comment = get_comment((int) $comment_id);
658
+ if ($comment && isset($comment->comment_type)) {
659
+ $comment_type = $comment->comment_type;
660
+ }
661
662
663
664
665
// Check if the comment type is in the allowlist
0 commit comments