debug: Check if rest_pre_dispatch is bypassing our handler
If rest_pre_dispatch returns non-null, WordPress skips the callback entirely. Will log: - NULL (will call handler) = normal, callback will execute - NON-NULL (handler bypassed!) = something is intercepting! This is the ONLY way our callback can be skipped after permission passes.
This commit is contained in:
@@ -28,7 +28,11 @@ class Routes {
|
|||||||
add_filter('rest_pre_dispatch', function($result, $server, $request) {
|
add_filter('rest_pre_dispatch', function($result, $server, $request) {
|
||||||
$route = $request->get_route();
|
$route = $request->get_route();
|
||||||
$method = $request->get_method();
|
$method = $request->get_method();
|
||||||
error_log("WooNooW REST: {$method} {$route}");
|
$result_type = is_null($result) ? 'NULL (will call handler)' : 'NON-NULL (handler bypassed!)';
|
||||||
|
error_log("WooNooW REST: {$method} {$route} - Result: {$result_type}");
|
||||||
|
if (!is_null($result)) {
|
||||||
|
error_log("WooNooW REST: BYPASSED! Result type: " . gettype($result));
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}, 10, 3);
|
}, 10, 3);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user