From 77b8a1f50c2ef8f0a6b8baadcc5764128cd064e5 Mon Sep 17 00:00:00 2001 From: Brady Vercher Date: Thu, 10 Oct 2024 10:01:45 -0700 Subject: [PATCH] Add a filter to set debug mode in the request handler. See #211 --- src/Provider/RequestHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Provider/RequestHandler.php b/src/Provider/RequestHandler.php index 86096ab..6937b50 100644 --- a/src/Provider/RequestHandler.php +++ b/src/Provider/RequestHandler.php @@ -183,6 +183,7 @@ protected function get_route_controller( string $route ): Route { * @return bool */ protected function is_debug_mode(): bool { - return \defined( 'WP_DEBUG' ) && true === WP_DEBUG; + $is_debug_mode = \defined( 'WP_DEBUG' ) && true === WP_DEBUG; + return apply_filters( 'satispress_debug_mode', $is_debug_mode ); } }