WordPress.org

Make WordPress Core

Ticket #17670: 17670.3.diff

File 17670.3.diff, 543 bytes (added by dd32, 7 years ago)
  • wp-includes/post.php

     
    31803180                        $curpage = wp_cache_get( $post_parent, 'posts' );
    31813181                        if ( false === $curpage )
    31823182                                $curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type = %s", $post_parent, $post_type ) );
     3183                        if ( ! $curpage )
     3184                                break;
    31833185                        $path = '/' . $curpage->post_name . $path;
    31843186                }
    31853187