public function matches(Request $request, $includingMethod = true)
{
// If this route uses a WordPress conditional tag
if ($this->condition()) {
// Loop trough every validator and if the route passes, return true else false.
foreach ($this->getWpValidators() as $validator) {
return $validator->matches($this, $request);
}
return false;
}
// If no WordPress condition is found, use the normal way of getting a route
$matches = parent::matches($request, $includingMethod);
// If we can not find a route using the normal laravel router check if the route which is being checked has the uri "404". If so we return this route as the valid one.
return !$matches && $this->getUri() === '404' ? true : $matches;
}