save_mod_rewrite_rules [ WordPress Function ]
save_mod_rewrite_rules ( No parameters )
| Defined at: |
|
Soorgelijke functies: add_rewrite_rule, iis7_save_url_rewrite_rules, iis7_add_rewrite_rule, flush_rewrite_rules, iis7_delete_rewrite_rule
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.
Source
<?php
function save_mod_rewrite_rules() {
if ( is_multisite() )
return;
global $wp_rewrite;
$home_path = get_home_path();
$htaccess_file = $home_path.'.htaccess';
// If the file doesn't already exist check for write access to the directory and whether we have some rules.
// else check for write access to the file.
if ((!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks()) || is_writable($htaccess_file)) {
if ( got_mod_rewrite() ) {
$rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() );
return insert_with_markers( $htaccess_file, 'WordPress', $rules );
}
}
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- save_mod_rewrite_rules
Function and Method Cross Reference. save_mod_rewrite_rules(). Defined at: / wp-admin/includes/misc.php -> line 114. Referenced 1 times: ...
phpxref.ftwr.co.uk - save_mod_rewrite_rules (WordPress Function) - WPSeek.com
WordPress lookup for save_mod_rewrite_rules, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - permalinks - After server migration only the homepage works ...
Apr 13, 2011 ... The function that actually writes the rewrite rules to .htaccess is called insert_with_markers (used in save_mod_rewrite_rules() above), defined ...
wordpress.stackexchange.com - Keep Wordpress From Overwriting .htaccess Rules | WebProNews
Jun 11, 2007 ... I had to dig through the WordPress Codex to see what was causing all the trouble . save_mod_rewrite_rules() is the culprit. That little function ...
www.webpronews.com