WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/shortcode exists

Contents

Description

Checks whether a specific shortcode exists.

Parameters

$tag
(string) (required) The shortcode to check for.
Default: None

Return

(boolean) 
True if the shortcode has been registered, false otherwise.

Usage

 <?php if ( shortcode_exists'gallery' ) ) { } ?> 

Example

<?php

if ( shortcode_exists( 'gallery' ) ) {
    // The [gallery] short code exists.
}

?>

Change Log

Source File

shortcode_exists() is located in wp-includes/shortcodes.php.

Related

Shortcode API

See also index of Function Reference and index of Template Tags.