This thread is resolved. Here is a description of the problem and solution.
Problem:
You are using WordPress with ACF Pro and WPML, and you have an ACF Relationship field named 'posts_to_display_in_grid' that allows multiple post types. The field is set to copy translations in WPML. While the order changes in the English (default language) backend and frontend are reflected correctly, changes made in the French backend do not persist, and the order reverts to English after saving. Additionally, the order on the French frontend does not match the backend.
Solution:
This issue appears to be related to a known problem documented on the WPML errata page. We recommend applying the workaround provided there. Please visit the following link for detailed instructions: WPML Errata Page.
If you need to apply a specific code, use the following:
add_filter( 'acf/load_value/type=relationship', 'format_order' );
function format_order( $value ){
$lang = apply_filters( 'wpml_current_language', null );
foreach ($value as $key => $id) {
$type = get_post_type($id);
$value[$key] = apply_filters( 'wpml_object_id', $id, $type, true, $lang);
}
return $value;
}If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML Support Forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 3 replies, has 0 voices.
Last updated by 2 weeks, 1 day ago.
Assisted by: Itamar.