Skip to content

Commit 4fe2f75

Browse files
committed
fix: all api request blocking
1 parent 7e5326c commit 4fe2f75

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

wittypen-integration.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,16 @@ function wittypen_display_api_key()
8686
EOT;
8787
}
8888

89-
function wittypen_authenticate_request($result)
90-
{
89+
function wittypen_authenticate_request($result) {
90+
// Get the current REST route
91+
$route = $_SERVER['REQUEST_URI'];
92+
93+
// Check if the route matches plugin's namespace (replace 'wittypen/v1' with your actual namespace)
94+
if (strpos($route, 'wittypen/v1') === false) {
95+
// This is not a request related to plugin, return the original result
96+
return $result;
97+
}
98+
9199
if (!empty($result)) {
92100
// Another authentication method is being used, return the result
93101
return $result;

0 commit comments

Comments
 (0)