Skip to content

Instantly share code, notes, and snippets.

@mir4a
Created October 14, 2013 03:55
Show Gist options
  • Save mir4a/6970485 to your computer and use it in GitHub Desktop.
Save mir4a/6970485 to your computer and use it in GitHub Desktop.
Update custom field mmm_term_id for lesson posts type that has category taxonomy
UPDATE `wp_posts`, `wp_term_relationships`
SET `wp_posts`.`mmm_term_id` = `wp_term_relationships`.`term_taxonomy_id`
WHERE `wp_posts`.`ID` = `wp_term_relationships`.`object_id` AND `wp_posts`.`post_type` = 'lesson'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment