Changeset 19734
- Timestamp:
- 01/13/2012 06:37:46 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r19729 r19734 1985 1985 $parent_where = array( 'post_parent' => $postid ); 1986 1986 1987 if ( is_post_type_hierarchical( $post->post_type ) ) { 1988 // Point children of this page to its parent, also clean the cache of affected children 1989 $children_query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type = %s", $postid, $post->post_type ); 1990 $children = $wpdb->get_results( $children_query ); 1991 1992 $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => $post->post_type ) ); 1993 } 1994 1987 1995 if ( 'page' == $post->post_type) { 1988 1996 // if the page is defined in option page_on_front or post_for_posts, … … 1995 2003 delete_option('page_for_posts'); 1996 2004 } 1997 1998 // Point children of this page to its parent, also clean the cache of affected children1999 $children_query = $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type='page'", $postid);2000 $children = $wpdb->get_results($children_query);2001 2002 $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'page' ) );2003 2005 } else { 2004 2006 unstick_post($postid); … … 2036 2038 if ( 'page' == $post->post_type ) { 2037 2039 clean_page_cache($postid); 2038 2039 foreach ( (array) $children as $child )2040 clean_page_cache($child->ID);2041 2040 } else { 2042 2041 clean_post_cache($postid); 2042 } 2043 2044 if ( is_post_type_hierarchical( $post->post_type ) ) { 2045 foreach ( (array) $children as $child ) 2046 clean_post_cache( $child->ID ); 2043 2047 } 2044 2048
Note: See TracChangeset
for help on using the changeset viewer.