WordPress.org

Make WordPress Core

Ticket #6860: 6860.diff

File 6860.diff, 829 bytes (added by wojtek.szkutnik, 8 years ago)
  • wp-includes/post.php

     
    40114011 *
    40124012 * @param int $id The Post ID in the cache to clean
    40134013 */
    4014 function clean_post_cache($id) {
     4014function clean_post_cache($id, $recursive = true) {
    40154015        global $_wp_suspend_cache_invalidation, $wpdb;
    40164016
    40174017        if ( !empty($_wp_suspend_cache_invalidation) )
     
    40284028
    40294029        do_action('clean_post_cache', $id);
    40304030
    4031         if ( $children = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d", $id) ) ) {
     4031        if ( $recursive && $children = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d", $id) ) ) {
    40324032                foreach( $children as $cid )
    40334033                        clean_post_cache( $cid );
    40344034        }