untrailingslashit( string $string )
Removes trailing forward slashes and backslashes if they exist.
Description #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.
Parameters #Parameters
- $string
-
(string) (Required) What to remove the trailing slashes from.
Return #Return
(string) String without the trailing slashes.
Source #Source
File: wp-includes/formatting.php
function untrailingslashit( $string ) { return rtrim( $string, '/\\' ); }
Expand full source code Collapse full source code View on Trac
Changelog #Changelog
Version | Description |
---|---|
2.2.0 | Introduced. |
Related #Related
Used By #Used By
Used By | Description |
---|---|
wp-admin/includes/class-wp-debug-data.php: WP_Debug_Data::get_sizes() |
Fetch the sizes of the WordPress directories: |
wp-admin/includes/class-wp-debug-data.php: WP_Debug_Data::debug_data() |
Static function for generating site debug data when required. |
wp-includes/ms-site.php: wp_initialize_site() |
Runs the initialization routine for a given site. |
wp-includes/l10n.php: load_script_textdomain() |
Loads the script translated strings. |
wp-includes/rest-api/class-wp-rest-request.php: WP_REST_Request::from_url() |
Retrieves a WP_REST_Request object from a full URL. |
wp-includes/functions.php: _wp_upload_dir() |
A non-filtered, non-cached version of wp_upload_dir() that doesn’t check the path. |
wp-includes/rest-api.php: rest_api_loaded() |
Loads the REST API. |
wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::handle_row_actions() |
Generates and displays row action links. |
wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::column_cb() |
Handles the checkbox column output. |
wp-admin/includes/class-wp-ms-sites-list-table.php: WP_MS_Sites_List_Table::column_blogname() |
Handles the site name column output. |
wp-signup.php: confirm_another_blog_signup() |
Confirm a new site signup. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::is_vcs_checkout() |
Check for version control checkouts. |
wp-admin/includes/class-wp-filesystem-ssh2.php: WP_Filesystem_SSH2::mkdir() |
Creates a directory. |
wp-admin/includes/class-wp-filesystem-ftpext.php: WP_Filesystem_FTPext::mkdir() |
Creates a directory. |
wp-admin/includes/class-wp-filesystem-base.php: WP_Filesystem_Base::search_for_folder() |
Locates a folder on the remote filesystem. |
wp-admin/includes/class-wp-filesystem-direct.php: WP_Filesystem_Direct::mkdir() |
Creates a directory. |
wp-includes/formatting.php: url_shorten() |
Shorten a URL, to be used as link text. |
wp-admin/includes/upgrade.php: get_alloptions_110() |
Retrieve all options as it was for 1.2. |
wp-admin/includes/post.php: get_sample_permalink() |
Get a sample permalink based off of the post name. |
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() |
Creates a directory. |
wp-admin/includes/file.php: unzip_file() |
Unzips a specified ZIP file to a location on the filesystem via the WordPress Filesystem Abstraction. |
wp-admin/includes/file.php: _unzip_file_ziparchive() |
Attempts to unzip an archive using the ZipArchive class. |
wp-admin/includes/file.php: _unzip_file_pclzip() |
Attempts to unzip an archive using the PclZip library. |
wp-includes/theme.php: register_theme_directory() |
Register a directory that contains themes. |
wp-includes/formatting.php: trailingslashit() |
Appends a trailing slash. |
wp-includes/functions.php: _config_wp_home() |
Retrieve the WordPress home page URL. |
wp-includes/functions.php: _config_wp_siteurl() |
Retrieve the WordPress site URL. |
wp-includes/widgets/class-wp-widget-rss.php: WP_Widget_RSS::widget() |
Outputs the content for the current RSS widget instance. |
wp-includes/link-template.php: user_trailingslashit() |
Retrieves a trailing-slashed string if the site is set for adding trailing slashes. |
wp-includes/option.php: get_option() |
Retrieves an option value based on an option name. |
wp-includes/nav-menu-template.php: _wp_menu_item_classes_by_context() |
Add the class property classes for the current context, if applicable. |
wp-includes/canonical.php: wp_redirect_admin_locations() |
Redirects a variety of shorthand URLs to the admin. |
wp-includes/functions.php: recurse_dirsize() |
Get the size of a directory recursively. |
wp-includes/ms-deprecated.php: install_blog() |
Install an empty blog. |