Unlike the /widget endpoint, /popular-posts doesn't detect the presence of WPML/Polylang and returns posts in the original language instead.
To Reproduce
Steps to reproduce the behavior:
Install either WPML or Polylang and translate some posts.
Load the /wp-json/wordpress-popular-posts/v1/popular-posts/ endpoint (either via AJAX or using a browser tab) and use the lang parameter to set the current locale (eg. ?lang=es).
The endpoint ignores the parameter returning posts in their original language (eg. English) instead.
Expected behavior
Like the /widget endpoint, /popular-posts should be able to detect the current locale and act accordingly.
Describe the bug
Unlike the
/widget
endpoint,/popular-posts
doesn't detect the presence of WPML/Polylang and returns posts in the original language instead.To Reproduce
Steps to reproduce the behavior:
lang
parameter to set the current locale (eg.?lang=es
).Expected behavior
Like the
/widget
endpoint,/popular-posts
should be able to detect the current locale and act accordingly.Environment: