• Working on a simple plugin that creates two custom post types. I run the flush_rewrite_rules on plugin activation which works fine. I am also trying to run it when deactivating. but that is not working. Any ideas as to what could be wrong with this simple code?

    ## Setup the Plugin Activation ##
    function gmt_audition_activate(){
    	cpt_audition_init(); //Audition Custom Post Type.
    	cpt_tryout_init(); //Tryout Custom Post Type.
    	flush_rewrite_rules(); //Flush the WordPress ReWrite Rules.
    }
    register_activation_hook( __FILE__, 'gmt_audition_activate' );
    
    ## Deactivating the Plugin ##
    function gmt_audition_deactivate(){
    	flush_rewrite_rules(); //Flush the WordPress ReWrite Rules.
    }
    register_deactivation_hook( __FILE__, 'gmt_audition_deactivate' );

The topic ‘flush_rewrite_rules not working on deactivation.’ is closed to new replies.