[wp-hackers] Network Activate and rewrite rules

Shawn Parker shawn at crowdfavorite.com
Mon Aug 23 18:52:49 UTC 2010


You can also inspect the rules on being pulled from the DB and force a rebuild when they're not present. Use the 'transient_rewrite_rules' filter to inspect the rules after they're pulled from the db. If your rule isn't there you can return a null value and it'll force the rules to rebuild. Its a little heavy, yes, but if the site breaks badly without those rules its a good backup plan to have in place.


Shawn Parker
Web Developer
Crowd Favorite
http://crowdfavorite.com
shawn at crowdfavorite.com

On Aug 22, 2010, at 8:07 AM, Arne Brachhold wrote:

> 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
>> 
> _______________________________________________
> 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