Rewrite rules don't need to be flushed on every page save/delete as they're no longer verbose. Fixes #19636.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2012-01-10 22:55:38 +00:00
parent 81a7ad2c81
commit 3c0d45d77c
1 changed files with 1 additions and 18 deletions

View File

@ -2038,8 +2038,6 @@ function wp_delete_post( $postid = 0, $force_delete = false ) {
foreach ( (array) $children as $child )
clean_page_cache($child->ID);
$wp_rewrite->flush_rules(false);
} else {
clean_post_cache($postid);
}
@ -4590,20 +4588,10 @@ function _publish_post_hook($post_id) {
}
/**
* Hook used to prevent page/post cache and rewrite rules from staying dirty.
*
* Does two things. If the post is a page and has a template then it will
* update/add that template to the meta. For both pages and posts, it will clean
* the post cache to make sure that the cache updates to the changes done
* recently. For pages, the rewrite rules of WordPress are flushed to allow for
* any changes.
*
* The $post parameter, only uses 'post_type' property and 'page_template'
* property.
* Hook used to prevent page/post cache from staying dirty when a post is saved.
*
* @since 2.3.0
* @access private
* @uses $wp_rewrite Flushes Rewrite Rules.
*
* @param int $post_id The ID in the database table for the $post
* @param object $post Object type containing the post information
@ -4611,11 +4599,6 @@ function _publish_post_hook($post_id) {
function _save_post_hook($post_id, $post) {
if ( $post->post_type == 'page' ) {
clean_page_cache($post_id);
// Avoid flushing rules for every post during import.
if ( !defined('WP_IMPORTING') ) {
global $wp_rewrite;
$wp_rewrite->flush_rules(false);
}
} else {
clean_post_cache($post_id);
}