How to Enable embedding WordPress default gallery in comments?

I want to embed WordPress default gallery in comments which has embed code like this:

To do so, I added this code which enables shortcodes in the comments:

add_filter( ‘comment_text’, ‘do_shortcode’ )

But someone suggested that is not a secure way to do so. Hence, how should I enable shortcodes in comments the right way or for now I can manage with only gallery shortcode too if there is a way to do that?

Read more here:: How to Enable embedding WordPress default gallery in comments?

Leave a Reply

Your email address will not be published. Required fields are marked *