WP_URL_Pattern_Prefixer::escape_pattern_string( string $str ): string

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Escapes a string for use in a URL pattern component.

Description

See also

Parameters

$strstringrequired
String to be escaped.

Return

string String with backslashes added where required.

Source

private static function escape_pattern_string( string $str ): string {
	return addcslashes( $str, '+*?:{}()\\' );
}

Changelog

VersionDescription
6.8.0Introduced.

User Contributed Notes

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