save_mod_rewrite_rules()
Updates the htaccess file with the current rules if it is writable.
Always writes to the file if it exists and is writable to ensure that we blank out old rules.
No Hooks.
Return
true|false|null
. True on write success, false on failure. Null in multisite.
Usage
save_mod_rewrite_rules();
Examples
#1 Disable the .htaccess update
By default when flush_rewrite_rules() is called, save_mod_rewrite_rules() is triggered. If we don't need this behavior, we can disable it with flush_rewrite_rules_hard hook:
add_filter( 'flush_rewrite_rules_hard', '__return_false' );
Notes
- Global. WP_Rewrite. $wp_rewrite WordPress rewrite component.
Changelog
Since 1.5.0 | Introduced. |