Ticket #11373: 11373.diff
File 11373.diff, 785 bytes (added by , 15 years ago) |
---|
-
wp-includes/post.php
2104 2104 $path = '/' . $leaf_path; 2105 2105 $curpage = $page; 2106 2106 while ($curpage->post_parent != 0) { 2107 $curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type='page'", $curpage->post_parent )); 2107 $post_parent = $curpage->post_parent; 2108 $curpage = wp_cache_get($post_parent, 'posts'); 2109 if ( $curpage === false) 2110 $curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type='page'", $post_parent )); 2108 2111 $path = '/' . $curpage->post_name . $path; 2109 2112 } 2110 2113