Uma área de pesquisa sobre o WordPress para devs e autores do tema



backslashit ›

Desde0.71
Obsoleton/a
backslashit ( $string )
Parâmetros:
  • (string) $string Value to which backslashes will be added.
    Required: Yes
Retorna:
  • (string) String with backslashes inserted.
Definido em:
Codex:

Adds backslashes before letters and before a number at the start of a string.



Fonte

function backslashit( $string ) {
	if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' ) {
		$string = '\\\\' . $string;
	}
	return addcslashes( $string, 'A..Za..z' );
}