Shortcode in Gutenberg block or do_shortcode

Question

I am wondering which differences there are between to put a shortcode in a Gutenberg block and using the do_shortcode function.

In particular, I wonder why the function

has_shortcode($post->post_content, $key)

doesn’t work if I use do_shortcode, but the same control is working correctly if I put a shortcode directly in the page using a Gutenberg block.

Is that a bug?

Thanks in advance.

0
bechicco 2 years 2020-10-24T04:10:37-05:00 0 Answers 7 views 0

Leave an answer

Browse
Browse