Resolved by author
Resolved in: Blocksy Companion 2.0.33
Overview of the issue
In the Blocksy theme, when using the Products Tab feature with WPML, tabs translated into a secondary language may incorrectly display in the original language on the front end.
Workaround
Please, make sure of having a full backup of your site before proceeding.
- Open the …/wp-content/plugins/blocksy-companion-pro/framework/premium/extensions/woocommerce-extra/features/custom-tabs/feature.php file
- Look for line 139.
- Replace:
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, ]);
- With:
$all_products_tabs = get_posts([ 'numberposts' => -1, 'post_type' => $this->post_type, // WPML Workaround for compsupp-7255 - PART 1 'suppress_filters' => false ]);
- Then, open the …/wp-content/plugins/blocksy-companion-pro/framework/features/conditions/rules-resolver.php file
- Look for line 364.
- Replace:
if ( isset($rule['payload']) && isset($rule['payload']['post_id']) && $post_id && intval($post_id) === intval($rule['payload']['post_id']) ) { return true; }
- With:
// 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; }