mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 22:58:40 +02:00
Use get_pages() instead of a raw SQL query in get_body_class().
fixes #28159. Built from https://develop.svn.wordpress.org/trunk@28696 git-svn-id: http://core.svn.wordpress.org/trunk@28513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c54618ab9c
commit
6d7e222ded
@ -594,8 +594,9 @@ function get_body_class( $class = '' ) {
|
|||||||
|
|
||||||
$classes[] = 'page-id-' . $page_id;
|
$classes[] = 'page-id-' . $page_id;
|
||||||
|
|
||||||
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) ) )
|
if ( get_pages( array( 'parent' => $page_id, 'number' => 1 ) ) ) {
|
||||||
$classes[] = 'page-parent';
|
$classes[] = 'page-parent';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $post->post_parent ) {
|
if ( $post->post_parent ) {
|
||||||
$classes[] = 'page-child';
|
$classes[] = 'page-child';
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.0-alpha-20140606';
|
$wp_version = '4.0-alpha-20140607';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user