Created
March 8, 2016 15:44
-
-
Save mikejolley/9e4f64ebb63266b79a1e to your computer and use it in GitHub Desktop.
One off category to job_listing_category conversion
This file contains hidden or 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
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