I'm trying to build a MySQL query to select last post by language (Polylang plugin) but I can't find what table and field does Polylang store the language of each post. Any clue?
The following mysql query will find all published wordpress posts which is in en language of polylang plugin:
SELECT * FROM wp_posts WHERE post_status = 'publish' AND ID IN (
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(description, '"en";i:', -1), ';',1) FROM `wp_term_taxonomy` WHERE `taxonomy` = 'post_translations' ) order by ID desc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With