Hi,
in your function duplicate_term I suggest to include something similar to:
So you can “link” the term with his relative posts.
/* NIKI: clona anche collegamenti tags => post */
$posts_with_term_args = array(
‘post_type’ => get_post_types(),
‘posts_per_page’ => -1,
‘tax_query’ => array(
array(
‘taxonomy’ => $taxonomy,
‘field’ => ‘id’,
‘terms’ => $term_id
)
)
);
$posts_with_term = get_posts( $posts_with_term_args );
foreach ( $posts_with_term as $postwterm ) {
wp_set_object_terms($postwterm->ID, $new_term[‘term_id’], $taxonomy, true);
}
wp_reset_query();
I need a plugin that I can use to copy one taxonomy’s items to another taxonomy. For instance, we have topics and topic1. I want to move all the topics under one custom post type to topic1.
It should copy, not move, from one existing taxonomy to another (it might move as well, but it must copy at least).
It should work for multilingual – WPML (translation).
It should work for standard and custom taxonomies (taxonomies created with a tool like CPT UI).
Will Duplicate Taxonomy Term be able to help us?
]]>