WordPress 7.0 Beta 5 :即将进入 RC 阶段,新功能与稳定性全面升级
WordPress 7.0 开发进程迎来关键节点——最后一个 Beta ...
在字符串末尾添加 /
添加之前会删除字符串末尾已有的 /,这样可以防止添加两个 /
<?php trailingslashit( $string ) ?>
$string
(string) (required) 将添加 / 的字符串。
Default: None
(string)
已经添加 / 的字符串
<?php
$path = trailingslashit( 'http://blog.wpjam.com' );
?>
$path 将输出
http://blog.wpjam.com/
使用 untrailingslashit() 函数来删除字符串末尾已有的 /。
Since: 1.2.0
wp-includes/formatting.php
评论交流(0)