Place this in your theme functions:
function mysite_clone_post($post_id, $post, $update) {
if(!$update && in_category('home cat', $post)) { //not handled updates and will only run if in this category
$post_fields = array( 'post_author', 'post_date', 'post_date_gmt', 'post_content',
'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type',
'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping',
'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order',
'post_mime_type', 'guid', 'tax_input', 'meta_input');
$postarr = array();
foreach($post as $k => $v) if(in_array($k, $post_fields)) $postarr[$k] = $v;
$postarr['ID'] = 0;
$postarr['post_category'] = array('casa cat');
//not handled post_parent
wp_insert_post($postarr); //not handled errors - returns false on error
}
}
add_action('save_post', 'mysite_clone_post', 10, 3);
As mentioned in the comments in the code, I have only handled new posts without post parents, and left out error handling.
I am also assuming there are only two categories and simply assigning the opposite one.
UPDATE:
For custom post types and taxonomies use the following:
function mysite_clone_post($post_id, $post, $update) {
if(!$update && $post->post_type == 'myposttype' && has_term('home cat name, id or slug', 'mytaxonomy', $post)) { //not handled updates and will only run if it is this custom post type and in this custom category
$post_fields = array( 'post_author', 'post_date', 'post_date_gmt', 'post_content',
'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type',
'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping',
'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order',
'post_mime_type', 'guid', 'tax_input', 'meta_input');
$postarr = array();
foreach($post as $k => $v) if(in_array($k, $post_fields)) $postarr[$k] = $v;
$postarr['ID'] = 0;
//not handled post_parent
if($newid = wp_insert_post($postarr)) { //if saved successfully, add taxonomy, note that the value is assigned to $newid and not compared
wp_set_object_terms($newid, 'desired cat id or slug', 'mytaxonomy');
} else {
//handle errors here
}
}
}
add_action('save_post', 'mysite_clone_post', 10, 3);
In addition, to handle multiple category pairs, you could use an array but then you’d have to update it everytime you add a new category. I’d suggest naming (and using) the slugs in such a way that one can be easily derived from the other. So e.g. ‘main_cat’ and ‘main_cat_ar’.
Then the first line would become:
if(!$update && $post->post_type == 'myposttype') { //not handled updates and will only run if it is this custom post type
$terms = get_the_terms($post, 'mytaxonomy');
if(!is_array($terms) || count(explode('_ar', $terms[0]->slug)) > 1) return; // if no terms were returned or it belongs to an arabic category, exit
and the line assigning the term to the new post becomes
wp_set_object_terms($newid, $terms[0]->slug.'_ar', 'mytaxonomy');