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



untrailingslashit › WordPress Function

Desde2.2.0
Obsoleton/a
untrailingslashit ( $value )
Parâmetros:
  • (string) $text Value from which trailing slashes will be removed.
    Required: Yes
Retorna:
  • (string) String without the trailing slashes.
Definido em:
Codex:

Removes trailing forward slashes and backslashes if they exist.

The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.


Fonte

function untrailingslashit( $value ) {
	return rtrim( $value, '/\\' );
}