OSDN Git Service

WordPressテンプレート機能更新。
authornaoki hirata <naoki@magic3.org>
Tue, 18 Jul 2017 06:25:16 +0000 (15:25 +0900)
committernaoki hirata <naoki@magic3.org>
Tue, 18 Jul 2017 06:25:16 +0000 (15:25 +0900)
include/wp/menuApi.php
include/wp/wp-includes/class-walker-page.php

index 32edf88..59d1781 100644 (file)
@@ -100,6 +100,7 @@ class MenuApi extends BaseApi
                        $post->post_title = $item->title;
                        $post->post_content = '';
                        $post->guid = $item->flink;     // 詳細画面URL
+                       $post->active = $item->active;
                        $post->filter = 'raw';
                
                        $wpPostObj = new WP_Post($post);
index 0881840..3862b73 100644 (file)
@@ -122,7 +122,10 @@ class Walker_Page extends Walker {
                        $css_class[] = 'page_item_has_children';
                }
 
-               if ( ! empty( $current_page ) ) {
+               // 現在のページがカレントかどうか判断
+               if ($page->active) $css_class[] = 'current_page_item';
+
+/*             if ( ! empty( $current_page ) ) {
                        $_current_page = get_post( $current_page );
                        if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) {
                                $css_class[] = 'current_page_ancestor';
@@ -134,7 +137,7 @@ class Walker_Page extends Walker {
                        }
                } elseif ( $page->ID == get_option('page_for_posts') ) {
                        $css_class[] = 'current_page_parent';
-               }
+               }*/
 
                /**
                 * Filters the list of CSS classes to include with each page item in the list.
@@ -164,7 +167,7 @@ class Walker_Page extends Walker {
                        '<li class="%s"><a href="%s">%s%s%s</a>',
                        $css_classes,
 //                     get_permalink( $page->ID ),
-                       $page->guid,                    // Magic3修正
+                       $page->guid,                    // Magic3è\8f«ï½®è±\81ï½£
                        $args['link_before'],
                        /** This filter is documented in wp-includes/post-template.php */
                        apply_filters( 'the_title', $page->post_title, $page->ID ),