Opened 14 years ago
Closed 12 years ago
#20905 closed enhancement (fixed)
Allow rewrite endpoints to specify a different query variable name
| Reported by: | johnbillion | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | Rewrite Rules | Version: | |
| Severity: | normal | Keywords: | needs-codex |
| Cc: | Focuses: |
Description
Using add_rewrite_endpoint() we can add an endpoint such as /foo/bar/ which maps to foo=bar. I'd like to be able to map an endpoint to a query variable of a different name. Currently the query variable name always matches the endpoint name.
Example: I'd like to use /p/{number} as a nice short endpoint for some custom functionality, but the 'p' query variable is used by core. I'd like to be able to map /p/3/ to my_query_var=3.
Attachments (1)
Change History (9)
#4
@
12 years ago
- Component Permalinks → Rewrite Rules
- Keywords needs-codex commit added
- Milestone Awaiting Review → 3.9
Patch still applies cleanly to trunk. I'd like to get this in 3.9.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch which adds an optional third parameter to
add_rewrite_endpoint()for specifying the name of the corresponding query variable. Defaults to the endpoint name.