Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created October 12, 2018 14:31
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 billerickson/1ecd7b1ea1a632cc3081a063a868338d to your computer and use it in GitHub Desktop.
Save billerickson/1ecd7b1ea1a632cc3081a063a868338d to your computer and use it in GitHub Desktop.
<?php
/**
* Migrate data from Taxonomy Images plugin to WP Term Images
*
* @author Bill Erickson
* @see https://www.billerickson.net/code/migrate-taxonomy-images-to-wp-term-images
*/
function be_migrate_taxonomy_images() {
$taxonomy_images = get_option( 'taxonomy_image_plugin' );
$meta_key = 'image';
foreach( $taxonomy_images as $term_id => $image_id ) {
update_term_meta( $term_id, $meta_key, $image_id );
}
}
add_action( 'wp_footer', 'be_migrate_taxonomy_images' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment