[wp-hackers] WP_Rewrite query

Scott Merrill skippy at skippy.net
Sat Feb 4 23:21:03 GMT 2006

Andy Skelton wrote:
> The function $wp->parse_request() does the work of finding the rule
> that matches the request. It never populates any member of the $_GET
> array. Instead it populates the array $wp->query_vars.
> It doesn't just grab every query var from the rewritten query
> willy-nilly. It only sets those vars named in $wp->public_query_vars.
> If you want to add a varname to the list, use the 'query_vars' filter.
> function nr_query_vars($array) {
>  $array[]='library';
>  return $array;
> }
> add_filter('query_vars', 'nr_query_vars');

I'm late to this discussion, because I've just realized that I'd like to
use a custom permalink structure for a project.  Specifically, I want to
use semi-Julian dates (date('z') in PHP).  I see how to insert the
query_var, and the regex is easy enough (/\d{3}/)m but I don't see how
to get in to manipulate WordPress' date variables.

I'm not asking for anyone to write my code for me, but a more thorough
example than the ones presented so far would go a long way to help
unmuddle the water for me.


skippy at skippy.net | http://skippy.net/

gpg --keyserver pgp.mit.edu --recv-keys 9CFA4B35
506C F8BB 17AE 8A05 0B49  3544 476A 7DEC 9CFA 4B35

More information about the wp-hackers mailing list