WordPress.org

Make WordPress Core

Ticket #19636: 19636.diff

File 19636.diff, 1.5 KB (added by duck_, 2 years ago)
  • wp-includes/post.php

     
    20392039 
    20402040                foreach ( (array) $children as $child ) 
    20412041                        clean_page_cache($child->ID); 
    2042  
    2043                 $wp_rewrite->flush_rules(false); 
    20442042        } else { 
    20452043                clean_post_cache($postid); 
    20462044        } 
     
    45924590} 
    45934591 
    45944592/** 
    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. 
    45964594 * 
    4597  * Does two things. If the post is a page and has a template then it will 
    4598  * update/add that template to the meta. For both pages and posts, it will clean 
    4599  * the post cache to make sure that the cache updates to the changes done 
    4600  * recently. For pages, the rewrite rules of WordPress are flushed to allow for 
    4601  * any changes. 
    4602  * 
    4603  * The $post parameter, only uses 'post_type' property and 'page_template' 
    4604  * property. 
    4605  * 
    46064595 * @since 2.3.0 
    46074596 * @access private 
    4608  * @uses $wp_rewrite Flushes Rewrite Rules. 
    46094597 * 
    46104598 * @param int $post_id The ID in the database table for the $post 
    46114599 * @param object $post Object type containing the post information 
     
    46134601function _save_post_hook($post_id, $post) { 
    46144602        if ( $post->post_type == 'page' ) { 
    46154603                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                 } 
    46214604        } else { 
    46224605                clean_post_cache($post_id); 
    46234606        }