Rendering "Embed" Shortcode

Support MB Frontend Submission Rendering "Embed" Shortcode

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #43137
    PiotrPiotr
    Participant

    Hello,

    When I try to Add Media > embedding video from url with the frontend form, which results in adding [embed] shortcode into the content, the shortcode doesn't render, just an empty paragraph tag is visible in the browser's inspect tool.

    How can I enable it to be rendered on the frontend?

    Thanks.

    #43145
    PeterPeter
    Moderator

    Hello,

    Are you using the WYSIWYG field? I don't see the [embed] added to this field value, it adds the HTML tag <img>. However, you can follow the documentation to render the shortcode in the field content
    https://docs.metabox.io/fields/wysiwyg/#template-usage

    #43165
    PiotrPiotr
    Participant

    I couldn't make this work. I am showing the {{ post.content }} in a view.

    However, I made a shortcode with something like:

    	global $post;
    	$content = apply_filters( 'the_content', get_the_content( $post->ID ) );
    
    	return $content;
    

    following comments on this page and it works, the [embed] shortcode renders on the page.

    #43166
    PeterPeter
    Moderator

    Hello,

    I can see that issue on my demo site. The video embedded is not rendered in the frontend. I'm escalating this issue to the development team to fix it. Thank you.

    #43168
    PiotrPiotr
    Participant

    Thank you.
    I forgot to mention I use the WYSIWYG field, with

    'raw' => true,
    'options' => [
    	'wpautop' => false,
    ]

    But I tested with with disabling raw option as well.

    Anyway, custom WB shortcode for now solved the issue.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.