-
-
Save billerickson/1ecd7b1ea1a632cc3081a063a868338d to your computer and use it in GitHub Desktop.
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 | |
/** | |
* 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