Skip to content

Commit

Permalink
Using WordPress' query_var system to determine route param value.
Browse files Browse the repository at this point in the history
  • Loading branch information
incraigulous committed May 2, 2024
1 parent de5fefa commit 7ce18fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Middleware/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function handle(Request $request, Response $response, $next)
$uri = $request->getRequestUri();
$route_param = container()->make(Router::class)->config['route_param'] ?? null;

if ($route_param && $request->has($route_param)) {
$uri = $request->get($route_param);
if ($route_param && get_query_var($route_param)) {
$uri = get_query_var($route_param);
} else {
$routable_param_keys = apply_filters(namespace_string('routable_params'), [
'page',
Expand Down

0 comments on commit 7ce18fd

Please sign in to comment.