Ticket #19636: 19636.diff
| File 19636.diff, 1.5 KB (added by duck_, 18 months ago) |
|---|
-
wp-includes/post.php
2039 2039 2040 2040 foreach ( (array) $children as $child ) 2041 2041 clean_page_cache($child->ID); 2042 2043 $wp_rewrite->flush_rules(false);2044 2042 } else { 2045 2043 clean_post_cache($postid); 2046 2044 } … … 4592 4590 } 4593 4591 4594 4592 /** 4595 * Hook used to prevent page/post cache and rewrite rules from staying dirty.4593 * Hook used to prevent page/post cache from staying dirty when a post is saved. 4596 4594 * 4597 * Does two things. If the post is a page and has a template then it will4598 * update/add that template to the meta. For both pages and posts, it will clean4599 * the post cache to make sure that the cache updates to the changes done4600 * recently. For pages, the rewrite rules of WordPress are flushed to allow for4601 * any changes.4602 *4603 * The $post parameter, only uses 'post_type' property and 'page_template'4604 * property.4605 *4606 4595 * @since 2.3.0 4607 4596 * @access private 4608 * @uses $wp_rewrite Flushes Rewrite Rules.4609 4597 * 4610 4598 * @param int $post_id The ID in the database table for the $post 4611 4599 * @param object $post Object type containing the post information … … 4613 4601 function _save_post_hook($post_id, $post) { 4614 4602 if ( $post->post_type == 'page' ) { 4615 4603 clean_page_cache($post_id); 4616 // Avoid flushing rules for every post during import.4617 if ( !defined('WP_IMPORTING') ) {4618 global $wp_rewrite;4619 $wp_rewrite->flush_rules(false);4620 }4621 4604 } else { 4622 4605 clean_post_cache($post_id); 4623 4606 }