diff --git a/src/mantle/http/routing/class-rest-route-registrar.php b/src/mantle/http/routing/class-rest-route-registrar.php index 2ee43ebc..4e536a26 100644 --- a/src/mantle/http/routing/class-rest-route-registrar.php +++ b/src/mantle/http/routing/class-rest-route-registrar.php @@ -174,7 +174,7 @@ public function register_routes(): void { * was already fired. */ protected function should_register_now(): bool { - return ! ! did_action( 'rest_api_init' ); + return function_exists( 'did_action' ) && ! ! did_action( 'rest_api_init' ); } /**