[wp-hackers] $wp_rewrite->flush_rules() on plugin activation

scribu scribu at gmail.com
Fri Dec 11 19:35:16 UTC 2009

With the insights gained from this topic, I've managed to create a reusable
boilerplate class that sets up all the necessary hooks. You can then just
focus on the actual rules.

Here's the source code:


And here is a usage example (in a plugin):

class MyRewrite extends scbRewrite {

    function generate() {
        global $wp_rewrite;


new MyRewrite(__FILE__);


More information about the wp-hackers mailing list