- Estado
- Resuelto por el autor
- Resuelto en
- Blocksy Companion 2.0.33
- Plugin/tema relacionado
- Blocksy
- Etiquetas de temática
- Compatibility
Resumen del problema
En el tema Blocksy, al usar la función Products Tab con WPML, las pestañas traducidas a un idioma secundario pueden mostrarse incorrectamente en el idioma original en el front-end.
Solución alternativa
Por favor, asegúrese de tener una copia de seguridad completa de su sitio antes de continuar.
- Abra el archivo …/wp-content/plugins/blocksy-companion-pro/framework/premium/extensions/woocommerce-extra/features/custom-tabs/feature.php
- Busque la línea 139.
- Reemplace:
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, ]);
- Por:
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, // WPML Workaround for compsupp-7255 - PART 1 'suppress_filters' => false ]);
- Luego, abra el archivo …/wp-content/plugins/blocksy-companion-pro/framework/features/conditions/rules-resolver.php
- Busque la línea 364.
- Reemplace:
if ( isset($rule['payload']) && isset($rule['payload']['post_id']) && $post_id && intval($post_id) === intval($rule['payload']['post_id']) ) { return true; } - Por:
// 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; }