PluginProbe
Metricool – Social media and site statistics / 2.1.1
Metricool – Social media and site statistics v2.1.1
2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
← All changes | app/Http/Middleware/SetLocale.php +3 -3 2.0.2 → 2.1.1 View file →
@@ -3,9 +3,9 @@
3 3 declare(strict_types=1);
4 4
5 5 namespace Metricool\Http\Middleware;
6 6
7 -use Carbon\Carbon;
7 +use Metricool\Vendor\Carbon\Carbon;
8 8 use Metricool\Interfaces\MiddlewareInterface;
9 9
10 10 /**
11 11 * Set the locale for the current request. The locale is determined by the user's locale, or the site's locale if the user is not logged in.
@@ -11,9 +11,9 @@
11 11 * Set the locale for the current request. The locale is determined by the user's locale, or the site's locale if the user is not logged in.
12 12 */
13 13 class SetLocale implements MiddlewareInterface
14 14 {
15 - public function handle(\WP_REST_Request $request): ?\WP_REST_Response
15 + public function handle(\WP_REST_Request $request, callable $next)
16 16 {
17 17 $locale = get_user_locale() ?: get_locale();
18 18 switch_to_locale($locale);
19 19
@@ -18,7 +18,7 @@
18 18 switch_to_locale($locale);
19 19
20 20 Carbon::setLocale($locale);
21 21
22 - return null;
22 + return $next($request);
23 23 }
24 24 }