WordPress.org

Make WordPress Core

Changeset 7601


Ignore:
Timestamp:
04/05/2008 05:54:08 AM (10 years ago)
Author:
matt
Message:

The child should not have to pay for the sins of his father. Caching for children needs to be cleared when parent is edited; if we check for empty and not isset, it never gets better for empty results.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r7592 r7601  
    27132713 */
    27142714function clean_page_cache($id) {
     2715    global $wpdb;
     2716    $id = (int) $id;
     2717
    27152718    clean_post_cache($id);
    27162719
     
    27192722
    27202723    do_action('clean_page_cache', $id);
     2724
     2725    if ( $children = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_parent = '$id'" ) )
     2726        foreach( $children as $cid )
     2727            clean_post_cache( $cid );
    27212728}
    27222729
     
    29442951    global $wpdb;
    29452952
    2946     if ( !empty($_post->ancestors) )
     2953    if ( !isset($_post->ancestors) )
    29472954        return;
    29482955
Note: See TracChangeset for help on using the changeset viewer.