Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Do you need to check if shortcode already exists in WordPress if you need that you can do it in just one minute using this code snippet.
Steps to check shortcode in WordPress:
function zytheme_shortcode_exists( $shortcode = '' ) { global $shortcode_tags; if ( $shortcode && array_key_exists( $shortcode, $shortcode_tags ) ){ return true; }else{ return false; } }
Add this code on your theme’s index.php file to check if the shortcode already exists.
if(zytheme_shortcode_exists('zytheme_button')){ echo 'button shortcode exists'; }
Did you find the WordPress snippets in this article helpful? Share it with your friends and if you have any questions and want to ask us about it, please don’t hesitate to add comments.