Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save attilabacso/43db7e026d4af327e64f8e4b74d4a42c to your computer and use it in GitHub Desktop.
Save attilabacso/43db7e026d4af327e64f8e4b74d4a42c to your computer and use it in GitHub Desktop.
# GET ALL WOOCOMMERCE PRODUCTS BY CATEGORY ID (124)
SELECT ID, post_title
FROM wp_posts
INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
WHERE wp_term_taxonomy.term_id IN(124)
GROUP BY ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment