[wp-hackers] Network Activate and rewrite rules

Arne Brachhold himself at arnebrachhold.de
Sun Aug 22 14:07:42 UTC 2010


Hi,

On Sun, Aug 22, 2010 at 02:09, Theodor Ramisch
<theodor_ramisch at hotmail.com> wrote:
> If somebody "network activates" the plugin, this hook is only called for the current blog. The plugin will be active, but all other blogs are missing the rewrite rules.
> What is the recommended way to correct this behavior?

I one of my plugins I don't add the rules on activation, but in the
init hook. Afterward you can set an option to indicate it was done. On
the next requests you can check for the option and skip the flushing.

- Arne

On Sun, Aug 22, 2010 at 02:09, Theodor Ramisch
<theodor_ramisch at hotmail.com> wrote:
>
> Hi all,
>
> I'm currently developing a plugin which adds some rewrite rules. Because it is recommended not to call flush_rules() on every request, I do this once in the activation hook.
>
> If somebody "network activates" the plugin, this hook is only called for the current blog. The plugin will be active, but all other blogs are missing the rewrite rules.
>
> What is the recommended way to correct this behavior?
>
> Best regards,
>
>  Theodor
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list