Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check if a shortcode already exists in WordPress
<?php
if ( shortcode_exists( 'gallery' ) ) {
echo 'The [gallery] shortcode already exists';
}
if ( !shortcode_exists( 'gallery' ) ) {
echo 'The [gallery] shortcode does not exist';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.