WordPress.org

Make WordPress Core

Ticket #11399: 11399.sw.1.diff

File 11399.sw.1.diff, 610 bytes (added by simonwheatley, 10 months ago)

Don't bother recursing into revisions when cleaning post caches as they won't have changed

  • post.php

     
    43894389                do_action( 'clean_page_cache', $post->ID ); 
    43904390        } 
    43914391 
    4392         if ( $children = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_type FROM $wpdb->posts WHERE post_parent = %d", $post->ID) ) ) { 
     4392        if ( $children = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_type FROM $wpdb->posts WHERE post_parent = %d AND post_type <> 'revision' ", $post->ID) ) ) { 
    43934393                foreach ( $children as $child ) { 
    43944394                        // Loop detection 
    43954395                        if ( $child->ID == $post->ID )