WordPress.org

Make WordPress Core

Ticket #18450: pre_flush_rewrite_rules action.diff

File pre_flush_rewrite_rules action.diff, 568 bytes (added by simonwheatley, 4 years ago)

Adds a new action, run just before flushing rewrite rules

  • wp-includes/rewrite.php

     
    18571857         * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard). 
    18581858         */ 
    18591859        function flush_rules($hard = true) { 
     1860                do_action( 'pre_flush_rewrite_rules', $hard ); 
    18601861                delete_option('rewrite_rules'); 
    18611862                $this->wp_rewrite_rules(); 
    18621863                if ( $hard && function_exists('save_mod_rewrite_rules') )