Make WordPress Core

Ticket #28159: 28159.2.diff

File 28159.2.diff, 622 bytes (added by SergeyBiryukov, 11 years ago)
  • src/wp-includes/post-template.php

     
    594594
    595595                $classes[] = 'page-id-' . $page_id;
    596596
    597                 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) ) )
     597                if ( get_pages( array( 'parent' => $page_id, 'number' => 1 ) ) ) {
    598598                        $classes[] = 'page-parent';
     599                }
    599600
    600601                if ( $post->post_parent ) {
    601602                        $classes[] = 'page-child';