Skip to content

Instantly share code, notes, and snippets.

@benlbot
benlbot / ACF_WPML_translate_relationship.php
Last active Sep 10, 2018
This function allow to translate (query translated objects) your ACF relationship fields
View ACF_WPML_translate_relationship.php
<?php
/**************************************************************************************************
*
* ACF / WPML translate relationship fields
*
*************************************************************************************************/
add_filter( 'wpml_duplicate_generic_string', 'my_override_post_duplication', 10, 3 );
function my_override_post_duplication( $value_to_filter, $target_language, $meta_data ) {
if ( isset($_POST['icl_ajx_action']) && $_POST['icl_ajx_action'] == "make_duplicates"){