Created
December 22, 2017 16:06
-
-
Save ebuildy/0794a07652878c28d75fd449c20a3e86 to your computer and use it in GitHub Desktop.
Wordpress wp-ml plugin: pivot term by languages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT wp_icl_translations.trid, | |
group_concat(case when wp_icl_translations.language_code = "sp" then wp_terms.name end) as title, | |
group_concat(case when wp_icl_translations.language_code = "sp" then wp_term_taxonomy.term_taxonomy_id end) as sp, | |
group_concat(case when wp_icl_translations.language_code = "en" then wp_term_taxonomy.term_taxonomy_id end) as en | |
FROM wp_terms | |
INNER JOIN wp_term_taxonomy ON wp_term_taxonomy.term_id = wp_terms.term_id | |
INNER JOIN wp_icl_translations ON wp_icl_translations.element_id = wp_term_taxonomy.term_taxonomy_id AND wp_icl_translations.element_type = "tax_event-categories" | |
WHERE wp_term_taxonomy.taxonomy = "event-categories" AND wp_term_taxonomy.parent = 0 | |
GROUP BY wp_icl_translations.trid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment