WIP: Shortcode Does Not Display on Frontend when Inside Metabox WYSIWYG Custom Field

Hi,

Issue

Frontend does not output Shortcode from a Metabox WYSIWYG Custom Field using the Basic Text element

I have a Shortcode (e.g. form/template/etc.) in a Metabox Custom Field and some placeholder text as a test.

Observations

  1. Tried 5 different ways to display the data, but the only element that worked was when I used the Code element.

Ask

Is there a reason why I am not able to render a Shortcode to display out properly from the WYSIWYG editor element?

Steps Taken

In Bricks:

I tried two methods, one in WYSIWYG and another using a Code element to pull back directly from what I believe is Metabox’s rwmb_meta wrapper function.

Using WYSIWYG Element.

image

Using Code element.

image

In WP Backend:

Shared with Zight

Result on Frontend:

Hi saint,
Thanks so much for your report!

Unfortunately, I cannot reproduce the issue. I tested it with a bricks section template shortcode + text in the Meta Box WYSIWYG field, and used the dynamic data tag ({mb_page_wysiwyg_ppdfemqnnni}) within the basic text, rich text, and shortcode element without issues on the frontend.

Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?

Best regards,
timmse

Thanks @saint ,

As per my email reply, it’s because all dynamic tags will be sanitized before using on an element. (wp_kses_post)
Recorded this issue, we may introduce a new Dynamic tag filter so you can skip the sanitization on certain dynamic tags.

Regards,
Jenn.

Hi @itchycode,

Thank you, I tested it in production and that was the issue. The code snippet worked perfectly.

For those that may run into the same issue, until a future release resolves this, the below temp. code snippet can serve as a workaround:

add_filter( 'wp_kses_allowed_html', function( $tags, $context ) {
  if ( ! isset( $tags['form'] ) ) {
    $tags['form'] = [
      'data-id' => true,
      'id' => true,
      'class' => true,
    ];
  }
  return $tags;
}, 100, 2 );