どうもGengoはキャッシュと相性が悪い、というかキャッシュを考慮してない様子。

WordPress自体、キャッシュ機能がデフォルトで無効になっている影響なのか、不具合や考慮もれがあちらこちらにありそう。

wp-hackers MLにもポストしたが、ちょこちょことパッチを作っている次第。

そのひとつに、サイドバーのページリストが、あるロケールでは表示されるけどそれ以外のロケールでは表示されない、という不具合がある。

wp_list_pages() にかわるgengo_list_pages()を作って解決を目指す。

<?php
if (!function_exists('gengo_list_pages')) {
function gengo_list_pages($args = '') {
    if (is_array($args)) {
        $r = &$args;
    } else {
        parse_str($args, $r);
    }
    $r = array_merge(array('language' => the_language(true)), $r);
    return wp_list_pages($r);
}
}
?>

/wp-includes/post.php にも不具合があるので、パッチ。

Index: post.php
===================================================================
--- post.php    (revision 3)
+++ post.php    (working copy)
@@ -1070,9 +1070,14 @@
        extract($r, EXTR_SKIP);

        $key = md5( serialize( $r ) );
-       if ( $cache = wp_cache_get( 'get_pages', 'page' ) )
-               if ( isset( $cache[ $key ] ) )
-                       return apply_filters('get_pages', $cache[ $key ], $r );
+       if ( $cache = wp_cache_get( 'get_pages', 'page' ) ) {
+               if ( isset( $cache[ $key ] ) ) {
+                       $pages = apply_filters('get_pages', $cache[ $key ], $r );
+            if ( $pages && ( $child_of || $hierarchical ) )
+                $pages = & get_page_children($child_of, $pages);
+            return $pages;
+        }
+    }

        $inclusions = '';
        if ( !empty($include) ) {