Codex

Function Reference/do shortcode

Contents

Description

Searches content for shortcodes and filters shortcodes through their hooks.

Usage

<?php do_shortcode$content ?>

Parameters

$content
(string) (required) Content to search for shortcodes
Default: None

Return Values

(string) 
Content with shortcodes replaced by the output from the shortcode's handler(s).

Examples

add_filter('the_content', 'do_shortcode', 11); // From shortcodes.php

Notes

If there are no shortcode tags defined, then the content will be returned without any filtering. This might cause issues if a plugin is disabled as its shortcode will still show up in the post or content.

Change Log

Since: 2.5

Source File

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

Related

Shortcode: do_shortcode, add_shortcode, remove_shortcode, remove_all_shortcodes, shortcode_atts, strip_shortcodes

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