This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is using the Unlimited Elements Post Grid in Elementor to display posts via Manual Selection. In the primary language, adding Post IDs or Post Names works correctly, but these do not display in the Advanced Translation Editor (ATE) for translation, causing no posts to display in the second language. Editing the post in the second language and adding Italian post IDs or Post Names works until the ATE is accessed again, after which the posts revert to English Post IDs or Titles.
Solution:
We recommend inserting the following custom PHP code into your theme's functions.php file to ensure that post IDs are correctly translated and maintained across language changes:
// WPML Workaround for compsupp-7445<br />add_filter('elementor/frontend/before_render', 'wpml_compsupp7445_filter_ucaddon_post_grid');<br /><br />function wpml_compsupp7445_filter_ucaddon_post_grid($element) {<br /> if ('ucaddon_post_grid' !== $element->get_name() ) {<br /> return;<br /> }<br /> $settings = $element->get_settings();<br /> if (isset($settings['post_list_manual_select_post_ids']) && is_array($settings['post_list_manual_select_post_ids'])) {<br /> foreach ($settings['post_list_manual_select_post_ids'] as $key => $id) {<br /> $post_type = get_post_type($id);<br /> if (!$post_type) {<br /> continue;<br /> }<br /> $id = apply_filters('wpml_object_id', $id, $post_type, true);<br /> unset($settings['post_list_manual_select_post_ids'][$key]);<br /> $settings['post_list_manual_select_post_ids'][] = $id;<br /> }<br /> $element->set_settings('post_list_manual_select_post_ids', $settings['post_list_manual_select_post_ids']);<br /> }<br /> if (isset($settings['post_list_manual_post_ids_dynamic'])) {<br /> if (is_string($settings['post_list_manual_post_ids_dynamic'])) {<br /> $settings['post_list_manual_post_ids_dynamic'] = explode(',', $settings['post_list_manual_post_ids_dynamic']);<br /> }<br /> if (is_array($settings['post_list_manual_post_ids_dynamic'])) {<br /> foreach ($settings['post_list_manual_post_ids_dynamic'] as $key => $id) {<br /> $post_type = get_post_type($id);<br /> if (!$post_type) {<br /> continue;<br /> }<br /> $translated_id = apply_filters('wpml_object_id', $id, $post_type, true);<br /> $settings['post_list_manual_post_ids_dynamic'][$key] = $translated_id;<br /> }<br /> $element->set_settings('post_list_manual_post_ids_dynamic', $settings['post_list_manual_post_ids_dynamic']);<br /> }<br /> }<br />}
If this solution does not resolve your issue or seems irrelevant due to updates or differences in your setup, we 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 the problem persists, please open a new support ticket with us.
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 6 replies, has 2 voices.
Last updated by 4 months, 2 weeks ago.
Assisted by: Kor.