ليس لدى هذا المستخدم أي مواضيع مفضلة.
مواضيع المنتدى المفضلة
مواضيع المنتدى التي تم إنشاؤها
الحالة |
الموضوع
|
داعم | الأصوات | المشاركات | الحداثة |
---|---|---|---|---|---|
Woodmart Video Product
1
2
بدأه: johnP-55
في: English Support
Problem: 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. |
|
2 | 19 | قبل 1 سنة |