Skip to content

Instantly share code, notes, and snippets.

@camaech
Created June 2, 2016 15:29
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 camaech/de22666dfe50a5ff99ed2ed32ff605b9 to your computer and use it in GitHub Desktop.
Save camaech/de22666dfe50a5ff99ed2ed32ff605b9 to your computer and use it in GitHub Desktop.
Add wp_postmeta to Custom Post Type MySql
INSERT INTO vsc_postmeta (post_id, meta_key, meta_value)
(SELECT ID AS post_id, 'division'
AS meta_key, 'north' AS meta_value
FROM vsc_posts WHERE ID NOT IN
(SELECT post_id FROM vsc_postmeta WHERE meta_key = 'division')
AND `post_type` = 'ivi_assignment_type');
@camaech
Copy link
Author

camaech commented Jun 2, 2016

This assumes 'division' is your meta_key and 'north' is the meta_value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment