Skip Navigation

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 7 replies, has 1 voice.

Last updated by Andrey 6 days, 12 hours ago.

Assisted by: Andrey.

Author Posts
June 6, 2025 at 1:13 pm #17114102

filipposD

Background of the issue:
I am trying to upload a video to an image using the Woodmart theme on my WordPress site hidden link. Initially, the default language was Greek, but it was later switched to English. Woodmart support suggested that the field woodmart_wc_video_gallery should be set to copy, which I did.

Symptoms:
When I upload a video in the default language, it does not appear anywhere. However, when I upload it in the secondary language, it appears as expected but not in the default language.

Questions:
Why is the video not appearing in the default language after uploading?
Could the issue be related to changing the default language from Greek to English?

June 8, 2025 at 3:40 pm #17116505

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Welcome to WPML support. I will answer this question before the ticket is assigned to one of my colleagues.

This behavior is tied to how Woodmart and WPML handle synchronization of custom fields during translation:

When a product is first created in English (initial default), its video gallery field (woodmart_wc_video_gallery) is saved and works correctly.

Changing the site’s default language (to Greek, in your case) breaks the linkage between the original and translated entries—so the video gallery doesn’t appear unless uploaded under the new default.

WPML requires a translation relationship between the “default-language product” and its translations for custom fields marked “Copy” to propagate correctly.

How to fix it

1. Mark woodmart_wc_video_gallery custom field as Copy

- In WPML → Settings → Custom Fields Translation, set woodmart_wc_video_gallery to Copy.

- This ensures the video URL is copied to translated versions automatically

2. Re-establish translation linkage for affected products

For each product:

- Go to the default-language product (English version).

- Make and save a minor change (e.g., change or add a title).

- Open its translation in Greek (or default language view).

- Use the WPML translation editor or manual translation screen.

- Ensure the translation record shows it is linked to the default product (not “Create new”).

- Complete the translation on save. This re-establishes the link, allowing the copied field to sync.

See if it fixes the issue.

Thanks.

June 10, 2025 at 1:30 pm #17122017

filipposD

unfortunately the issue persists. Would you like admin details for the staging site to check the issue?

June 10, 2025 at 2:45 pm #17122441

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

You need to update your WPML plugin and add-ons to the latest version, 4.7.6, to benefit from the latest bug fixes and improvements. This may not necessarily resolve your problem; however, we need to work on the latest code to troubleshoot the issue best.

You can check the latest released versions under "My Account -> Downloads" on this site. Instructions to update can be found here: http://wpml.org/faq/install-wpml/

If you do not see the updates, you might need to click the Check for updates button in the Plugins → Add New Plugin → Commercial tab.

Make sure to update WooCommerce plugin also to the latest version.

Remember to backup your database before you proceed.

If the issue persists after an update, please upload any relevant screenshots or links that would help illustrate the problem.

June 16, 2025 at 7:23 am #17137187

filipposD

Hello,

The problem is that we try to upload a video from the default language and nothing shows up.

If we try from the tranlsated language ( greek ) then the video appears in greek but as expected not in english.

Something that is a hint is that the Greek where the default language initially.

We tried to connect the translations by making a change and saving the translation as you had mentioned before but it did not worked.

June 16, 2025 at 8:31 am #17137373

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

Please test the following workaround by adding this code to the functions.php file:

// WPML Workaround for compsupp-7477
add_filter('get_post_metadata', 'wpml_compsupp7477_filter_woodmart_wc_video_gallery', 10, 4);
add_filter('woodmart_single_product_image_thumbnail_id', 'wpml_compsupp7477_translate_attachment_id', 10, 2);

function wpml_compsupp7477_filter_woodmart_wc_video_gallery($null, $object_id, $meta_key, $single) {
    
    // Target the specific meta key
    if ($meta_key !== 'woodmart_wc_video_gallery') {
        return $null;
    }

    // Prevent recursion by temporarily removing the filter
    remove_filter('get_post_metadata', 'wpml_compsupp7477_filter_woodmart_wc_video_gallery', 10);

    // Fetch the original meta value
    $video_gallery = get_post_meta($object_id, $meta_key, false);

    // Re-add the filter
    add_filter('get_post_metadata', 'wpml_compsupp7477_filter_woodmart_wc_video_gallery', 10, 4);

    // Check if we actually got an array
    if (isset($video_gallery[0]) && is_array($video_gallery[0])) {
        foreach ($video_gallery[0] as $key => $value) {
            // Apply the WPML filter to each item (video settings array key)
            $translated_key = apply_filters('wpml_object_id', $key, 'post', true);
            $video_gallery[0][$translated_key] = $value;
        }
    }

    return $video_gallery;
}

function wpml_compsupp7477_translate_attachment_id($attachment_id, $product) {
    return apply_filters('wpml_object_id', $attachment_id, get_post_type($attachment_id), true);
}

Please backup your database before making any changes.

June 17, 2025 at 8:29 am #17141308

filipposD

Thanks for the answer. Unfortunately the problem is not resolved. Let me clarify because I made a mistake as well.

The default language was changed from english to greek. In a woocommerce product all the product fields remain locked in greek and not english. Adding the video from english does nothing, adding it from greek adds it to greek but not to english. So it seems like changes are not passed from the default language to the translated language.

June 17, 2025 at 3:24 pm #17143146

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for the update.

Could you please upload some screenshots showing the steps you followed and the results you’re seeing? Does the same issue occur if you create and test with a new product?

This will help me better understand the situation and provide the most accurate assistance.