JOIN r2b5Y_icl_translations wpml_translations ON r2b5Y_posts.ID = wpml_translations.element_id AND wpml_translations.element_type = CONCAT('post_', r2b5Y_posts.post_type)