Skip to content

Instantly share code, notes, and snippets.

@nicoladj77
Created May 19, 2015 15:26
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 nicoladj77/932b8da25b87ad2d9dd9 to your computer and use it in GitHub Desktop.
Save nicoladj77/932b8da25b87ad2d9dd9 to your computer and use it in GitHub Desktop.
Possible split term
function bugs_update_content_split_terms( $old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
$term_meta = get_option( 'taxonomy_' . $old_term_id );
if ( 'espn_bug' === $taxonomy && $term_meta ) {
// We have a match, so we swap out the old tag ID for the new one and resave the option.
update_option( 'taxonomy_' . $new_term_id, $term_meta );
}
}
add_action( 'split_shared_term', 'bugs_update_content_split_terms', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment