shortcode_exists

Whether a registered shortcode exists named $tag.

Description

shortcode_exists( (string) $tag ); 

Parameters (1)

0. $tag (string)
Shortcode tag to check.

Usage

  1. if ( !function_exists( 'shortcode_exists' ) ) { 
  2. require_once ABSPATH . WPINC . '/shortcodes.php'; 
  3.  
  4. // Shortcode tag to check. 
  5. $tag = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = shortcode_exists($tag); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/shortcodes.php  
  1. function shortcode_exists( $tag ) { 
  2. global $shortcode_tags; 
  3. return array_key_exists( $tag, $shortcode_tags );