Our second tier support provided a workaround that allows to edit the tag so they are connected as a translation. I know that you don't mind about connecting them, but if they are not, then WordPress does not know the right language when retrieving them by slug.
Please try the following:
❌ Please make a full website backup before proceeding ❌
In your child theme functions.php file add:
/**
* Short-circuit the test for re-used tag slugs
* when editing a tag
*/
add_filter( 'terms_pre_query', 'wsmod_terms_pre_query', 10, 2 );
function wsmod_terms_pre_query( $terms, $term_query ){
if (
isset( $_REQUEST['taxonomy'] ) && $_REQUEST['taxonomy'] === 'post_tag'
&& isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'editedtag'
&& isset( $_REQUEST['tag_ID'] ) )
{
$term = get_term( $_REQUEST['tag_ID'], 'post_tag' );
$terms = array( $term );
}
return $terms;
}
Then edit the English slug and connect it to the Greek one as a translation. After this, the title should appear in the right language in the front end.
Thank you for your reply and for escalating the issue to the second tier.
We have implemented the code you've sent and, indeed, it is now possible to connect the terms. This is still not what we want, as we will have to manually connect all the affected terms. However, it is at least a way to address part of the issue.
So, although the issue is not 100% resolved, you can go ahead and close this.