[Plugin: Gengo] Gengo & WordPress 2.7 – some nasty flaws
-
Hello,
I am using WP 2.7 for a project which needs to be bilingual. For accomplising this I chose to implement Gengo. The problem is that it works flawlessly only with WP 2.3…
As a whole it is working good with WP 2.7 except some major problems with filtering the_category,wp_list_categories and the_tags (at least that’s what’s bugging me the most). When browsing archives (date, tag, search) or in single posts and pages wp_list_categories translates only categories to which the current post is assigned, and the_category does not get translated at all.
For the_category got round the problem like so:
foreach((get_the_category()) as $post_cats) { echo '<a href="'.get_category_link($post_cats->cat_ID).'">'; echo get_the_category_by_id($post_cats->cat_ID); echo '</a> '; }
But for wp_list_categories and get_categories I don’t know what to do… In my understanding (not good with programming), the filter that processes those calls is that (line 232 in gengo.php):
add_filter('list_cats', array(& $this,'list_cats'), 8, 2);
and this is the function attached to it(line 1332 in gengo.php):
/** * Translate the categories in lists, if necessary. * list_cats is sometimes called with the entire list, which we don't need. * * @param string $name * @param string $category */ function list_cats($name, $category = '') { global $wpdb, $wp_object_cache; if (!$category) return $name; return $wp_object_cache->cache['category'][$category->term_id]->name; }
Looks not very complex but I don’t understand a thing ??
this is a known issue:
https://www.ads-software.com/support/topic/176510
https://www.ads-software.com/support/topic/193803
https://jamietalbot.com/wp-hacks/forum/comments.php?DiscussionID=214&page=1#Item_0
https://jamietalbot.com/wp-hacks/forum/comments.php?DiscussionID=252&page=1#Item_0Please, if anyone has been tackling this or knows how to fix – drop a few lines ??
Thank you!
- The topic ‘[Plugin: Gengo] Gengo & WordPress 2.7 – some nasty flaws’ is closed to new replies.