[wp-hackers] Improving rewrite flexibility
Ryan Boren
ryan at boren.nu
Fri Jan 13 09:58:43 GMT 2006
On Fri, 2006-01-13 at 11:20 +0900, Jamie Talbot wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jamie Talbot wrote:
>
> Small alteration to what I wrote - you wouldn't need any reference to
> %language% in core code, obviously.
>
> >Maybe instead of:
> >
> >$date_rewrite =
> >$this->generate_rewrite_rules($this->get_date_permastruct());
> >$date_rewrite = apply_filters('date_rewrite_rules', $date_rewrite);
>
> >We could have:
>
> $number_of_tokens = preg_match_all('/%.+?%/',
> $this->get_date_permastruct(), $tokens);
> $tokens = $tokens[0];
> $date_rewrite = array();
> while ($number_of_tokens--)
> {
> $permalink_structure = '/';
> for ($i = 0; $i <= $number_of_tokens; $i++) $permalink_structure .=
> $tokens[$i] . '/';
> $date_rewrite += $this->generate_rewrite_rules($permalink_structure,
> true, true, false, false);
> }
> $date_rewrite = apply_filters('date_rewrite_rules', $date_rewrite);
I need to read over your proposal more carefully, but I think we can
accommodate. Probably not for 2.0.1 though. I don't want to risk
adding permalink bugs in a maintenance release. If you want to work on
a patch, I'll look it over for future inclusion.
Ryan
More information about the wp-hackers
mailing list