elasticpress-proxy icon indicating copy to clipboard operation
elasticpress-proxy copied to clipboard

Add WPML support

Open cristianorevil opened this issue 1 year ago • 2 comments

Add WPML support for in proxy for instant results

Description of the Change Actually the proxy doesn't support wmpl. Results of instant search is not filtered by current user language. To add support for wpml in necessary add these lines to proxy.php file at line 353:

foreach ($existing_filter['bool']['must'] as $key => $must_filter) { if ($must_filter['term']['post_lang.keyword'] != null) { $existing_filter['bool']['must'][$key]['term']['post_lang.keyword'] = $_COOKIE['wp-wpml_current_language']; } }

Alternate Designs None

Possible Drawbacks None

Verification Process Pulled the plugin into my WordPress installation and tested the results of instant search.

Checklist: I have read the CONTRIBUTING document. My code follows the code style of this project. My change requires a change to the documentation. I have updated the documentation accordingly. I have added tests to cover my change. All new and existing tests passed.

cristianorevil avatar Feb 27 '23 14:02 cristianorevil