This thread is resolved. Here is a description of the problem and solution.
Problem:
Rehub theme reusable block is translated in both English and Arabic
Solution:
1- Edit the (wp-content\plugins\rehub-framework\includes\class-rehub.php) file
2- Replace the following code at line 101
/* Get REHub theme option value by key */ public static function get_option( $key ) { if ( function_exists( 'vp_option' ) ) { $value = vp_option( "rehub_option." . $key ); } else { $options = get_option( 'rehub_option' ); $value = (!empty($options[$key])) ? $options[$key] : ''; } return $value; }
With
/* Get REHub theme option value by key */ public static function get_option( $key ) { if ( function_exists( 'vp_option' ) && ! class_exists('SitePress') ) { $value = vp_option( "rehub_option." . $key ); } else { $options = get_option( 'rehub_option' ); $value = (!empty($options[$key])) ? $options[$key] : ''; } return $value; }
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.
Tagged: Compatibility
This topic contains 8 replies, has 2 voices.
Last updated by jonathanH-15 1 year, 8 months ago.
Assisted by: Osama Mersal.
Author | Posts |
---|---|
April 29, 2023 at 11:16 am #13560931 | |
jonathanH-15 |
Tell us what you are trying to do? Is there a similar example that we can see? What is the link to your site? |
May 2, 2023 at 6:10 am #13566895 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for contacting WPML forums support. I'll be glad to help you today. 1) First of all, sorry for the late reply due to a higher workload. Could you please make sure that the English footer is published, not a draft? Also, please check if the translated template is assigned correctly. 2) Could you please share your Debug information with me? Best regards, |
May 3, 2023 at 10:46 pm #13582207 | |
jonathanH-15 |
I've provided debug information |
May 4, 2023 at 7:56 am #13583513 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for the debug information. Please let me know if you checked the translated block status. If it's published, and you still face the issue, I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP) Your next answer will be private, which means only you and I can access it. ❌ Please backup your database and website ❌ ✙ I would need your permission to de-activate and re-activate the Plugins and the Theme and change configurations on the site. This is also a reason the backup is critical. ✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site. Best regards, |
May 5, 2023 at 7:42 pm #13596563 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for the access details. I checked the issue and tried some workarounds with no luck, so it could be a compatibility issue. Please login to this sandbox site and upload your theme. (hidden link) After that, please create a test footer and translate it to replicate the issue. If the issue is replicable, please let me know how to reproduce it. Thanks for your cooperation Best regards, |
May 6, 2023 at 3:10 am #13597383 | |
jonathanH-15 |
Hi Osama, thank you so much for your support in trying to debug the issue. I have uploaded the theme and reproduced the issue. The reusable template will translate normally if it was added within the post but it will not be translated if it was added as a footer (you can check the post as well as the footer as they all include the same reusable template). In order to use the reusable template as a footer I create a new reusable template with the default language and in the Section type settings I select (Footer). Then I translate the template to the secondary language and select the section Type of the translated template as (Footer) too. Then in the Theme options – Footer options – Custom Footer Templates, I select the footer layout as one of the created footer templates. |
May 7, 2023 at 5:01 am #13599673 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for replicating the issue. I've consulted our compatibility team regarding the issue, and I'll update you as soon as I get their reply. Thanks for your cooperation and patience Best regards, |
May 9, 2023 at 10:43 am #13612577 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for your patience. Our compatibility team has found a workaround for the issue by the following steps: 1- Edit the (wp-content\plugins\rehub-framework\includes\class-rehub.php) file /* Get REHub theme option value by key */ public static function get_option( $key ) { if ( function_exists( 'vp_option' ) ) { $value = vp_option( "rehub_option." . $key ); } else { $options = get_option( 'rehub_option' ); $value = (!empty($options[$key])) ? $options[$key] : ''; } return $value; } With /* Get REHub theme option value by key */ public static function get_option( $key ) { if ( function_exists( 'vp_option' ) && ! class_exists('SitePress') ) { $value = vp_option( "rehub_option." . $key ); } else { $options = get_option( 'rehub_option' ); $value = (!empty($options[$key])) ? $options[$key] : ''; } return $value; } I've applied the above steps to the sandbox site. Please check it and let me know if it works correctly. Best regards, |
May 11, 2023 at 11:14 am #13629705 | |
jonathanH-15 |
I have tested this workaround at my live website and it worked as expected and my issue was solved. Thank you so much for your valuable time and support in debugging the issue.😀 |