Ticket #10361: 10361.diff

File 10361.diff, 522 bytes (added by Denis-de-Bernardy, 4 years ago)
Line 
1Index: wp-includes/post-template.php
2===================================================================
3--- wp-includes/post-template.php       (revision 1996)
4+++ wp-includes/post-template.php       (working copy)
5@@ -427,7 +427,7 @@
6 
7                $classes[] = 'page-id-' . $pageID;
8 
9-               if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' LIMIT 1", $pageID) ) )
10+               if ( empty($wp_query->post->ancestors) )
11                        $classes[] = 'page-parent';
12 
13                if ( $wp_query->post->post_parent ) {