跳到内容 跳到侧边栏

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using WPBakery Page Builder with WPML, you might experience the following issue: vc_raw_html shortcodes are removed during translation when using the Advanced Translation Editor (ATE). This results in missing content on the translated page.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/plugins/js_composer/include/helpers/helpers.php file.
  • Look for line 1946.
  • Replace:
    		if ( vc_user_access()->part( 'unfiltered_html' )->checkStateAny( true, null )->get() ) {
            
  • With:
    		if ( vc_user_access()->part( 'unfiltered_html' )->checkStateAny( true, null )->get() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
            
  • Save your original page and translate it using the “+” icon.

2 个回复 至 “WPBakery Page Builder - Raw HTML Shortcodes Removed When Translating with ATE”

  1. Hi,

    Thank you for sharing this workaround.

    We’ve tested it on our side and can confirm that after applying the change, the issue is resolved and the content is displayed correctly.

    However, we have two important concerns:

    The fix modifies a plugin file, so it will be overwritten during future updates (WPBakery / Uncode). This makes it difficult to maintain long-term.

    It broadens the conditions under which raw HTML is allowed, which could potentially introduce a security risk. In the event of an attack, this could be considered a security vulnerability.

    Because of this, we see the workaround as a temporary solution rather than something safe to rely on in production long term.

    We wanted to flag this early and would appreciate guidance on a more permanent and update-safe approach.

    Kind regards,

    • Hi Agata,

      Thanks for your feedback! This issue appears to be a regression introduced in WPBakery 8.7. The workaround is quite similar to the original code that was in place up to version 8.6.1, which is (for reference):

      function wpb_remove_custom_html( $content ) {
      $is_rest_request = ( defined( 'REST_REQUEST' ) && REST_REQUEST );
      if ( ! empty( $content ) && ! $is_rest_request && ! vc_user_access()->part( 'unfiltered_html' )->checkStateAny( true, null )->get() ) {

      We’ve already reported the issue to the plugin author, but it might help to reinforce the urgency if you also reach out to them as a customer.

发表回复

保持话题相关并尊重他人。如果您需要与此帖子无关的问题帮助,请使用我们的支持论坛开始聊天或提交工单。

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>