Created
July 13, 2013 16:48
-
-
Save alexkingorg/5991297 to your computer and use it in GitHub Desktop.
Convert existing threads and categories to projects.
This file contains 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
<?php | |
function akv3_convert_to_projects() { | |
global $wpdb; | |
// convert categories | |
$wpdb->query(" | |
UPDATE wp_term_taxonomy | |
SET taxonomy = 'projects', | |
parent = 0 | |
WHERE term_id IN (13, 14, 15, 20, 22, 52, 53, 58, 59) | |
"); | |
// convert threads | |
$wpdb->query(" | |
UPDATE wp_term_taxonomy | |
SET taxonomy = 'projects', | |
parent = 0 | |
WHERE term_id IN (400, 417, 438, 455) | |
"); | |
$wpdb->query(" | |
UPDATE wp_posts | |
SET post_type = 'project' | |
WHERE ID IN (15866, 15874, 15876, 15878) | |
"); | |
$wpdb->query(" | |
UPDATE wp_postmeta | |
SET meta_key = '_cf-tax-post-binding_projects' | |
WHERE meta_key = '_cf-tax-post-binding_threads' | |
AND post_id IN (15866, 15874, 15876, 15878) | |
"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment