This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing issues with the video function in your product not working, we have identified a solution.
Solution:
We recommend adding the following code into the
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 ensure to backup your database before implementing this code.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your specific case, 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 17 replies, has 2 voices.
Last updated by Andrey 3 months, 2 weeks ago.
Assisted by: Andrey.