Don't write to htaccess every time page is saved. Add hard/soft flush flag to flush_rules(). Make sure fopen is successful and silence errors. Props Viper007Bond. fixes #10181 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@11578 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-06-16 02:44:28 +00:00
parent a7105d5e12
commit 2aa1252ebe
4 changed files with 10 additions and 7 deletions
+2 -2
View File
@@ -1192,7 +1192,7 @@ function wp_delete_post($postid = 0) {
foreach ( (array) $children as $child )
clean_page_cache($child->ID);
$wp_rewrite->flush_rules();
$wp_rewrite->flush_rules(false);
} else {
clean_post_cache($postid);
}
@@ -3354,7 +3354,7 @@ function _save_post_hook($post_id, $post) {
// Avoid flushing rules for every post during import.
if ( !defined('WP_IMPORTING') ) {
global $wp_rewrite;
$wp_rewrite->flush_rules();
$wp_rewrite->flush_rules(false);
}
} else {
clean_post_cache($post_id);