Opened 12 months ago
Last modified 9 months ago
#20905 new enhancement
Allow rewrite endpoints to specify a different query variable name
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Permalinks | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | info@…, justin@… |
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 (4)
johnbillion — 12 months ago
comment:1
johnbillion — 12 months ago
- Keywords has-patch added
comment:3
greenshady — 9 months ago
- Cc justin@… added
Note: See
TracTickets for help on using
tickets.

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.