我决定创建SQL查询:
SELECT posts.post_title, posts.post_content, trans.element_type,
trans.language_code
FROM wp_posts AS posts
INNER JOIN wp_icl_translations AS trans
ON posts.ID = trans.element_id
INNER JOIN wp_postmeta AS meta
ON posts.ID = meta.post_id
WHERE trans.element_type = \'post_product\'
AND trans.language_code = \'de\'
仅当您需要post\\u meta上的某些内容时,才会添加此项:
...
INNER JOIN wp_postmeta AS meta
ON posts.ID = meta.post_id
...
我的解决方案是通过语言获取所有帖子
trans.language_code = \'de\'
,
trans.language_code = \'es\'
,
trans.language_code = \'en\'
...