strip_shorcode_tag( array   $m ): string|false

Strips a shorcode tag based on RegEx matches against post content.

Parameters

$m array required
RegEx matches against post content.

Return

string|false The content stripped of the tag, otherwise false.

Source

function strip_shorcode_tag( $m ) {
	// Allow [[foo]] syntax for escaping a tag.
	if ( '[' === $m[1] && ']' === $m[6] ) {
		return substr( $m[0], 1, -1 );
	}

	return $m[1] . $m[6];
}

Changuelog

Versionen Description
3.3.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.