function do_shortcode($content) {}

Search content for shortcodes and filter shortcodes through their hooks.
If there are no shortcode tags defined, then the content will be returned without any filtering. This might cause issues when plugins are disabled but the shortcode will still show up in the post or content.


  • string $content: Content to search for shortcodes

Return values

returns:Content with shortcodes filtered out.

Source code

function do_shortcode($content) {

	global $shortcode_tags;

	if (empty($shortcode_tags) || !is_array($shortcode_tags))

		return $content;

	$pattern = get_shortcode_regex();

	return preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $content );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: