Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/wp-json/wordpress-popular-posts/v1/popular-posts/ endpoint doesn't translate posts #284

Closed
cabrerahector opened this issue Feb 15, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@cabrerahector
Copy link
Owner

cabrerahector commented Feb 15, 2021

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:

  1. Install either WPML or Polylang and translate some posts.
  2. 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).
  3. 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.

Environment:

  • WordPress version: 5.6.1
  • Plugin version: 5.2.4
@cabrerahector cabrerahector added this to the 5.3.0 milestone Feb 15, 2021
@cabrerahector cabrerahector self-assigned this Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant