| @@ -13,9 +13,9 @@ | ||
| 13 | 13 | class IsWordPressAdminRequest implements MiddlewareInterface |
| 14 | 14 | { |
| 15 | 15 | use HasRestAccess; |
| 16 | 16 | |
| 17 | - public function handle(\WP_REST_Request $request): ?\WP_REST_Response | |
| 17 | + public function handle(\WP_REST_Request $request, callable $next) | |
| 18 | 18 | { |
| 19 | 19 | if (!is_admin()) { |
| 20 | 20 | return $this->sendHttpErrorResponse( |
| 21 | 21 | __('Unauthorized. Please log in into the WordPress admin.', 'metricool'), |
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | 401 |
| 24 | 24 | ); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - return null; | |
| 27 | + return $next($request); | |
| 28 | 28 | } |
| 29 | 29 | } |