| @@ -307,8 +307,14 @@ | ||
| 307 | 307 | * @param string $route Full REST route (e.g. /thinkrank/v1/schema/...). |
| 308 | 308 | * @return string |
| 309 | 309 | */ |
| 310 | 310 | public static function capability_for_route(string $route): string { |
| 311 | + // Routes match case-insensitively in WP_REST_Server, and every key in | |
| 312 | + // route_map() and settings_category_map() is lowercase, so a section | |
| 313 | + // spelled /SiteMap/ must resolve to the same capability as /sitemap/ | |
| 314 | + // rather than fall back to the base access cap (#975). | |
| 315 | + $route = strtolower($route); | |
| 316 | + | |
| 311 | 317 | // Settings-management categories resolve by category rather than by |
| 312 | 318 | // prefix — see settings_category_map() for why this one route differs. |
| 313 | 319 | if (preg_match('#/thinkrank(?:-pro)?/v1/settings-management/category/([a-zA-Z0-9_-]+)#', $route, $c)) { |
| 314 | 320 | return self::capability_for_settings_category($c[1]); |