OSDN Git Service

WordPressテンプレート機能更新。
authornaoki hirata <naoki@magic3.org>
Fri, 14 Jul 2017 06:05:03 +0000 (15:05 +0900)
committernaoki hirata <naoki@magic3.org>
Fri, 14 Jul 2017 06:05:03 +0000 (15:05 +0900)
include/wp/wp-includes/post-template.php

index db26d80..356e92d 100644 (file)
@@ -595,8 +595,10 @@ function get_body_class( $class = '' ) {
                $classes[] = 'error404';
 
        if ( is_singular() ) {
-               $post_id = $wp_query->get_queried_object_id();
-               $post = $wp_query->get_queried_object();
+//             $post_id = $wp_query->get_queried_object_id();
+//             $post = $wp_query->get_queried_object();
+               $post_id = $wp_query->post->ID;
+               $post = $wp_query->post;
                $post_type = $post->post_type;
 
                if ( is_page_template() ) {
@@ -639,7 +641,8 @@ function get_body_class( $class = '' ) {
                } elseif ( is_page() ) {
                        $classes[] = 'page';
 
-                       $page_id = $wp_query->get_queried_object_id();
+       //              $page_id = $wp_query->get_queried_object_id();
+                       $page_id = $wp_query->post->ID;
 
                        $post = get_post($page_id);