[wp-trac] Re: [WordPress Trac] #2433: Provide some API for
WP_Rewrite
WordPress Trac
wp-trac at lists.automattic.com
Mon Mar 13 02:22:15 GMT 2006
#2433: Provide some API for WP_Rewrite
----------------------------+-----------------------------------------------
Id: 2433 | Status: new
Component: Administration | Modified: Mon Mar 13 02:22:15 2006
Severity: normal | Milestone: 2.1
Priority: normal | Version: 2.0.1
Owner: anonymous | Reporter: davidhouse
----------------------------+-----------------------------------------------
Comment (by majelbstoat):
The improvements here seem great - good work! Couple of questions though:
Is there a clean way to add a regex endpoint that can have multiple
possibilities?
Like /(en|fr|de|ja)/ being handled. As I can see it,
add_endpoint('/(en|fr|de|ja)/', EP_ALL) would add that regex to the end of
each url, but then adds a query var of the same regex. I'd want it to add
a query_var of 'language' I'm looking for something like
add_rewrite_tag($tag, $pattern, $query) but for endpoints, like:
add_endpoint($pattern, $places, $query='') instead of just
add_endpoint($name, $places)
then:
add_endpoint_pattern('(en|fr|de|ja)', EP_ALL, 'language');
That shouldn't be too hard to implement should it? If $query is
specified, use that as the query_var. If it remains empty, just use the
pattern as now.
Also, what if I wanted to add an endpoint after another endpoint? Am I
still looking at using the rewrite_rules_array() filter?
Finally, what does add_query_var() actually do? It adds to an array
public_query_vars, but I can't find where that is being used?
--
Ticket URL: <http://trac.wordpress.org/ticket/2433>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list