Skip to content

Instantly share code, notes, and snippets.

@fenriz07
Created April 25, 2019 17:40
Show Gist options
  • Save fenriz07/0380e18fc50a50eb3140e34dfd5216c8 to your computer and use it in GitHub Desktop.
Save fenriz07/0380e18fc50a50eb3140e34dfd5216c8 to your computer and use it in GitHub Desktop.
For anybody else landing here with this problem, WPML now adds a post_lang attribute the posts' mappings. (I'm using 3.9.4)
It also adds a post_filter argument to the request itself so it considers this post_lang in ElasticPress queries.
One problem remains : the indexing is still for a unique language as described in this issue.
To resolve this, add a filter to suppress WPML's filter on the indexing
add_filter('ep_index_posts_args', function($args) {
return array_merge($args, [
'suppress_filters' => true,
]);
});
https://github.com/10up/ElasticPress/issues/477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment