unescape_invalid_shortcodes() WordPress Function

The unescape_invalid_shortcodes() function is used to unescape invalid shortcodes in a string. This is useful for when you want to output a string containing shortcodes that may be invalid, but you don't want them to be parsed by the shortcode parser.

unescape_invalid_shortcodes( string $content ) #

Remove placeholders added by do_shortcodes_in_html_tags().


Parameters

$content

(string)(Required)Content to search for placeholders.


Top ↑

Return

(string) Content with placeholders removed.


Top ↑

Source

File: wp-includes/shortcodes.php

function unescape_invalid_shortcodes( $content ) {
	// Clean up entire string, avoids re-parsing HTML.
	$trans = array(
		'[' => '[',
		']' => ']',
	);

	$content = strtr( $content, $trans );

	return $content;
}


Top ↑

Changelog

Changelog
VersionDescription
4.2.3Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.