WP_URL_Pattern_Prefixer::escape_pattern_string
Escapes a string for use in a URL pattern component.
Method of the class: WP_URL_Pattern_Prefixer{}
No Hooks.
Returns
String
. String with backslashes added where required.
Usage
$result = WP_URL_Pattern_Prefixer::escape_pattern_string( $str ): string;
- $str(string) (required)
- String to be escaped.
Notes
Changelog
Since 6.8.0 | Introduced. |
WP_URL_Pattern_Prefixer::escape_pattern_string() WP URL Pattern Prefixer::escape pattern string code WP 6.8.1
private static function escape_pattern_string( string $str ): string { return addcslashes( $str, '+*?:{}()\\' ); }