Forums › Forums › Search & Filter Pro › Translate form search with WP Globus / qTranslate X
- This topic has 3 replies, 2 voices, and was last updated 10 years, 8 months ago by
Ross.
-
Anonymous(Private) November 6, 2015 at 10:29 am #29038
Hi,
I’m using a multilanguage plugin called WP Globus, it works like qTranslate, store all languages alternatives for each post in the same post. WP Globus insert all texts using special language delimiters: {:en}Hallo{:}{:es}Hola{:} , with qTranslate X [:en]Hallo[:][:es]Hola[:]
I use this filter to show in each language:
<?php echo apply_filters( ‘the_title’, {:en}Hallo{:}{:es}Hola{:} ); ?>
How could I use this with Search and Filter?
Ross Moderator(Private) November 9, 2015 at 8:01 pm #29302Hey Jose
I’m afraid I have no idea how that plugin works or how to set that up.
I’ll try to take a look when I find some time but really busy at the moment.
We only officially support WPML at the moment (and are almost there with Polylang), although users’ have reported qTranslate working also.
Thanks
Anonymous(Private) November 10, 2015 at 3:57 pm #29410Hey Ross,
With colaboration with WP Globus Team I attach this function to get run WP Globus and Search And Filter:
add_filter( 'get_post_metadata', 'wpglobus_metadata__filter', 10, 4 ); function wpglobus_metadata__filter( $null, $object_id, $meta_key, $single ) { if (!is_admin()) { if ( '_search-filter-fields' == $meta_key ) { $meta_type = 'post'; $meta_cache = wp_cache_get($object_id, $meta_type . '_meta'); if ( !$meta_cache ) { $meta_cache = update_meta_cache( $meta_type, array( $object_id ) ); $meta_cache = $meta_cache[$object_id]; } if ( ! $meta_key ) { return $meta_cache; } if ( isset($meta_cache[$meta_key]) ) { if ( $single ) { $value = maybe_unserialize( $meta_cache[$meta_key][0] ); for ($i = 0 ; $i<count($value) ; $i++) { $value[$i]['heading'] = WPGLobus_Core::text_filter($value[$i]['heading'], WPGlobus::Config()->language ); $value[$i]['all_items_label'] = WPGLobus_Core::text_filter($value[$i]['all_items_label'], WPGlobus::Config()->language ); if (!empty($value[$i]['meta_options'][0]['option_label'])) $value[$i]['meta_options'][0]['option_label'] = WPGLobus_Core::text_filter($value[$i]['meta_options'][0]['option_label'], WPGlobus::Config()->language ); } return array( 0 => $value ); } else { return array_map('maybe_unserialize', $meta_cache[$meta_key]); } } } return null; } }How about?
-
AuthorPosts