返回介绍

untrailingslashit()

发布于 2017-09-11 11:01:07 字数 3658 浏览 981 评论 0 收藏 0

untrailingslashit( string $string )

Removes trailing forward slashes and backslashes if they exist.


description

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.


参数

$string

(string) (Required) What to remove the trailing slashes from.


返回值

(string) String without the trailing slashes.


源代码

File: wp-includes/formatting.php

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

更新日志

Versiondescription
2.2.0Introduced.

相关函数

Used By

  • wp-includes/rest-api/class-wp-rest-request.php: WP_REST_Request::from_url()
  • wp-includes/functions.php: _wp_upload_dir()
  • wp-includes/rest-api.php: rest_api_loaded()
  • wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::handle_row_actions()
  • wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::column_cb()
  • wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::column_blogname()
  • wp-signup.php: confirm_another_blog_signup()
  • wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::is_vcs_checkout()
  • wp-admin/includes/class-wp-filesystem-ssh2.php: WP_Filesystem_SSH2::mkdir()
  • wp-admin/includes/class-wp-filesystem-ftpext.php: WP_Filesystem_FTPext::mkdir()
  • wp-admin/includes/class-wp-filesystem-direct.php: WP_Filesystem_Direct::mkdir()
  • wp-admin/includes/class-wp-filesystem-base.php: WP_Filesystem_Base::search_for_folder()
  • wp-includes/formatting.php: url_shorten()
  • wp-admin/includes/upgrade.php: get_alloptions_110()
  • wp-admin/includes/post.php: get_sample_permalink()
  • wp-admin/includes/class-wp-comments-list-table.php: WP_Comments_List_Table::column_author()
  • wp-admin/includes/class-wp-filesystem-ftpsockets.php: WP_Filesystem_ftpsockets::mkdir()
  • wp-admin/includes/file.php: unzip_file()
  • wp-admin/includes/file.php: _unzip_file_ziparchive()
  • wp-admin/includes/file.php: _unzip_file_pclzip()
  • wp-includes/theme.php: register_theme_directory()
  • wp-includes/formatting.php: trailingslashit()
  • wp-includes/functions.php: _config_wp_home()
  • wp-includes/functions.php: _config_wp_siteurl()
  • wp-includes/widgets/class-wp-widget-rss.php: WP_Widget_RSS::widget()
  • wp-includes/link-template.php: user_trailingslashit()
  • wp-includes/option.php: get_option()
  • wp-includes/nav-menu-template.php: _wp_menu_item_classes_by_context()
  • wp-includes/canonical.php: wp_redirect_admin_locations()
  • wp-includes/ms-functions.php: recurse_dirsize()
  • wp-includes/ms-functions.php: install_blog()
  • Show 26 more used by Hide more used by

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文