shortcode_exists() – Function | Developer.WordPress.org
Determines whether a registered shortcode exists named $tag.
Parameters
$tagstringrequiredShortcode tag to check.
Return
bool Whether the given shortcode exists.Source
function shortcode_exists( $tag ) {
global $shortcode_tags;
return array_key_exists( $tag, $shortcode_tags );
}
| Used by | Description |
|---|---|
has_shortcode()wp-includes/shortcodes.php | Determines whether the passed content contains the specified shortcode. |
Changelog
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |
User Contributed Notes
-
Skip to note 2 content
Basic Example