Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert existing threads and categories to projects.
<?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
You can’t perform that action at this time.