From 3c0d45d77c0bd613d52e2045930c11de83ff5fbf Mon Sep 17 00:00:00 2001 From: duck_ Date: Tue, 10 Jan 2012 22:55:38 +0000 Subject: [PATCH] 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 --- wp-includes/post.php | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 458ad9e83e..289f55cc3f 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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); }