trailingslashit()

trailingslashit()

trailingslashit()


/**
* Appends a trailing slash.
*
* Will remove trailing forward and backslashes if it exists already before adding
* a trailing forward 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.
*
* @since 1.2.0
*
* @param string $value Value to which trailing slash will be added.
* @return string String with trailing slash added.
*/
function trailingslashit( $value ) {
return untrailingslashit( $value ) . ‘/’;
}

参考链接
https://developer.wordpress.org/reference/functions/trailingslashit/

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注