mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
Add filter flush_rewrite_rules_hard
to give devs chance to prevent writing to file when hard-flushing rewrite rules.
Props jeremyfelt, nacin. Fixes #23491. Built from https://develop.svn.wordpress.org/trunk@25328 git-svn-id: http://core.svn.wordpress.org/trunk@25290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3f5ec88eda
commit
2f267f6a2a
@ -1893,9 +1893,11 @@ class WP_Rewrite {
|
||||
function flush_rules($hard = true) {
|
||||
delete_option('rewrite_rules');
|
||||
$this->wp_rewrite_rules();
|
||||
if ( $hard && function_exists('save_mod_rewrite_rules') )
|
||||
if ( ! $hard || ! apply_filters( 'flush_rewrite_rules_hard', true ) )
|
||||
return;
|
||||
if ( function_exists( 'save_mod_rewrite_rules' ) )
|
||||
save_mod_rewrite_rules();
|
||||
if ( $hard && function_exists('iis7_save_url_rewrite_rules') )
|
||||
if ( function_exists( 'iis7_save_url_rewrite_rules' ) )
|
||||
iis7_save_url_rewrite_rules();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user