Skip to content

Instantly share code, notes, and snippets.

@indatawetrust
Created December 27, 2018 09:18
Show Gist options
  • Save indatawetrust/4bd8ce78b5a2d14511f2c7f0da426be0 to your computer and use it in GitHub Desktop.
Save indatawetrust/4bd8ce78b5a2d14511f2c7f0da426be0 to your computer and use it in GitHub Desktop.
SELECT t.term_id, t.name, t.slug
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt ON (t.term_id = tt.term_id)
INNER JOIN wp_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id)
WHERE tt.taxonomy IN ('course_category') AND tr.count > 0
ORDER BY t.name ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment