hi, i did solve this. i made some extra functions.
the copy is on purpose different then original.
first, the moment at which the filter function is called is important.
the calls:
add_action( ‘dp_duplicate_post’, ‘my_plugin_copy_post’, 2);
add_action(‘dp_duplicate_post’, ‘my_duplicate_post_copy_post_taxonomies_add_cat’, 50, 20); // very late moment
the functions:
function my_plugin_copy_post($new_post_id){
// set post format, the plugin ‘forgets’ to copy post-format
set_post_format ( $new_post_id, ‘video’);
// set post type
set_post_type ( $new_post_id, ‘datastick’); // from type is x to type is datastick
return;
}
function my_duplicate_post_copy_post_taxonomies_add_cat($new_post_id){
// set extra cat
$idObj = get_category_by_slug( ‘datastick’ );
$id1 = $idObj->term_id;
$cat_array = array( $id1 );
$append=true;
$test = wp_set_post_categories( $new_post_id, $cat_array, $append ); // cat set,overwrite = append
return;
}
best, jan