Closed jopeek closed 2 years ago
Yep, the wpp_custom_html
filter hook assumes that the developer (you in this case) will do everything related to the front-end, including integration with third-party plugins like WPML.
When using the stock HTML output WPP translates texts & URLs via the Translate class before rendering the popular posts list on screen.
Have a look at the Output class to see exactly how the plugin uses this class to translate posts, and if you have any questions feel free to ask.
Perfect, thank you!
I used the sample code for the custom html output for the WPP from https://github.com/cabrerahector/wordpress-popular-posts/wiki/3.-Filters#wpp_custom_html, and while it works great, it does not display the title of the post in the appropriate language (from WPML). It does show the correct url, but not the title. If I use the stock output code instead of wpp_custom_html, it shows the proper title. Is there something I can tweak in the wpp_custom_html sample code to get it to use the title from the current language?