Make WordPress Core

Ticket #28159: 28159.diff

File 28159.diff, 701 bytes (added by obenland, 8 years ago)
  • src/wp-includes/post-template.php

     
    585585
    586586                $classes[] = 'page-id-' . $page_id;
    587587
    588                 if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status = 'publish' LIMIT 1", $page_id) ) )
     588                if ( get_posts( array( 'fields' => 'ids', 'post_parent' => $page_id, 'post_type' => 'page', 'posts_per_page' => 1, 'suppress_filters' => false ) ) ) {
    589589                        $classes[] = 'page-parent';
     590                }
    590591
    591592                if ( $post->post_parent ) {
    592593                        $classes[] = 'page-child';