WordPress at Your Fingertips

shortcode_exists() WP 1.0

Whether a registered shortcode exists named $tag

1 time — 0.000011 sec (very fast) | 50000 times — 0.02 sec (speed of light) | PHP 7.1.5, WP 4.8.2

No Hooks.

Return

true|false. Whether the given shortcode exists.

Usage

shortcode_exists( $tag );
$tag(string) (required)
Shortcode tag to check.

Notes

  • Global. Array. $shortcode_tags List of shortcode tags and their callback hooks.

Changelog

Since 3.6.0 Introduced.

Code of shortcode_exists() WP 5.8.1

function shortcode_exists( $tag ) {
	global $shortcode_tags;
	return array_key_exists( $tag, $shortcode_tags );
}

Conditional tags (all)

Shortcodes

No comments
    Log In