[wp-hackers] Best practice way for a plugin to use WP_Rewrite

Matt Jacob matt at mattjacob.com
Tue Nov 10 15:40:01 UTC 2009


On Tue, Nov 10, 2009 at 1:41 AM, Dion Hulse (dd32) <wordpress at dd32.id.au> wrote:
> Simply add
> add_filter('rewrite_rules_array', array($this, 'InsertRewriteRules'));
> to your class's 'init' action function
>
> You only call the flush on YOUR activations, but anytime the rules are
> flushed by anything, then your filter is hooked ready to fire.
>
> Just hooking it by itself causes no negative effects.

Thanks! I swear I had tried that before, but now it looks like
everything is working nicely. That was the answer I was looking for.

Matt


More information about the wp-hackers mailing list