I’m using do_shortcode function to add shortcode in my template. But i would like to check if that shortcode exists before display them.

I mean like this

If (shortcode_gallery_exists) {
  echo do_shortcode('');
}

Can anyone help me? Thanks

7 s
7

#23572 introduced shortcode_exists() into 3.6.

Leave a Reply

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