- Statut
- Résolu par l’auteur
- Résolu dans
- Blocksy Companion 2.0.33
- Extension/thème associé
- Blocksy
- Étiquettes de sujet
- Compatibility
Aperçu de l’anomalie
Dans le thème Blocksy, lors de l’utilisation de la fonctionnalité Products Tab avec WPML, les onglets traduits dans une langue secondaire peuvent s’afficher de manière incorrecte dans la langue d’origine sur l’interface publique.
Solution de contournement
Assurez-vous d’avoir une sauvegarde complète de votre site avant de continuer.
- Ouvrez le fichier …/wp-content/plugins/blocksy-companion-pro/framework/premium/extensions/woocommerce-extra/features/custom-tabs/feature.php
- Cherchez la ligne 139.
- Remplacez :
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, ]);
- Par :
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, // WPML Workaround for compsupp-7255 - PART 1 'suppress_filters' => false ]);
- Ensuite, ouvrez le fichier …/wp-content/plugins/blocksy-companion-pro/framework/features/conditions/rules-resolver.php
- Cherchez la ligne 364.
- Remplacez :
if ( isset($rule['payload']) && isset($rule['payload']['post_id']) && $post_id && intval($post_id) === intval($rule['payload']['post_id']) ) { return true; } - Par :
// WPML Workaround for compsupp-7255 - Part 2 if ( class_exists('Sitepress') ) { $rule['payload']['post_id'] = apply_filters( 'wpml_object_id', $rule['payload']['post_id'], get_post_type($rule['payload']['post_id']) , TRUE ); } if ( isset($rule['payload']) && isset($rule['payload']['post_id']) && $post_id && intval($post_id) === intval($rule['payload']['post_id']) ) { return true; }