Hey 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?