Appends a trailing slash.
Will remove trailing slash if it exists already before adding a trailing slash. This prevents double slashing a string or path.
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.
<?php trailingslashit( $string ) ?>
<?php $path = trailingslashit( '/home/julien/bin/dotfiles' ); ?>
$path will now contain:
/home/julien/bin/dotfiles/
(Notice the trailing slash)
Since: 1.2.0
trailingslashit() is located in wp-includes/formatting.php
.