Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created March 8, 2016 15:44
Show Gist options
  • Save mikejolley/9e4f64ebb63266b79a1e to your computer and use it in GitHub Desktop.
Save mikejolley/9e4f64ebb63266b79a1e to your computer and use it in GitHub Desktop.
One off category to job_listing_category conversion
if ( taxonomy_exists( 'job_listing_category' ) ) {
$categories = get_terms( 'category' );
foreach ( $categories as $category ) {
if ( ! term_exists( $category->name, 'job_listing_category' ) ) {
wp_insert_term( $category->name, 'job_listing_category' );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment