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.
Parameters
$text
stringrequired- Value from which trailing slashes will be removed.
Return
string String without the trailing slashes.Source
function untrailingslashit( $value ) {
return rtrim( $value, '/\\' );
}
Related
Used by | Description |
---|---|
_wp_before_delete_font_face()wp-includes/fonts.php | Deletes associated font files when a font face is deleted. |
_wp_filter_font_directory()wp-includes/fonts.php | A callback function for use in the ‘upload_dir’ filter. |
WP_REST_URL_Details_Controller::parse_url_details()wp-includes/rest-api/endpoints/class-wp-rest-url-details-controller.php | Retrieves the contents of the title tag from the HTML response. |
wp_update_https_migration_required()wp-includes/https-migration.php | Updates the ‘https_migration_required’ option if needed when the given URL has been updated from HTTP to HTTPS. |
clean_dirsize_cache()wp-includes/functions.php | Cleans directory size cache used by recurse_dirsize() . |
WP_Debug_Data::get_sizes()wp-admin/includes/class-wp-debug-data.php | Fetches the sizes of the WordPress directories: |
WP_Debug_Data::debug_data()wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required. |
wp_initialize_site()wp-includes/ms-site.php | Runs the initialization routine for a given site. |
load_script_textdomain()wp-includes/l10n.php | Loads the script translated strings. |
rest_preload_api_request()wp-includes/rest-api.php | Append result of internal request to REST API for purpose of preloading data to be attached to a page. |
WP_REST_Request::from_url()wp-includes/rest-api/class-wp-rest-request.php | Retrieves a WP_REST_Request object from a full URL. |
_wp_upload_dir()wp-includes/functions.php | A non-filtered, non-cached version of wp_upload_dir() that doesn’t check the path. |
rest_api_loaded()wp-includes/rest-api.php | Loads the REST API. |
WP_MS_Sites_List_Table::handle_row_actions()wp-admin/includes/class-wp-ms-sites-list-table.php | Generates and displays row action links. |
WP_MS_Sites_List_Table::column_cb()wp-admin/includes/class-wp-ms-sites-list-table.php | Handles the checkbox column output. |
WP_MS_Sites_List_Table::column_blogname()wp-admin/includes/class-wp-ms-sites-list-table.php | Handles the site name column output. |
confirm_another_blog_signup()wp-signup.php | Shows a message confirming that the new site has been created. |
WP_Automatic_Updater::is_vcs_checkout()wp-admin/includes/class-wp-automatic-updater.php | Checks for version control checkouts. |
WP_Filesystem_SSH2::mkdir()wp-admin/includes/class-wp-filesystem-ssh2.php | Creates a directory. |
WP_Filesystem_FTPext::mkdir()wp-admin/includes/class-wp-filesystem-ftpext.php | Creates a directory. |
WP_Filesystem_Base::search_for_folder()wp-admin/includes/class-wp-filesystem-base.php | Locates a folder on the remote filesystem. |
WP_Filesystem_Direct::mkdir()wp-admin/includes/class-wp-filesystem-direct.php | Creates a directory. |
url_shorten()wp-includes/formatting.php | Shortens a URL, to be used as link text. |
get_alloptions_110()wp-admin/includes/upgrade.php | Retrieve all options as it was for 1.2. |
get_sample_permalink()wp-admin/includes/post.php | Returns a sample permalink based on the post name. |
WP_Comments_List_Table::column_author()wp-admin/includes/class-wp-comments-list-table.php | |
WP_Filesystem_ftpsockets::mkdir()wp-admin/includes/class-wp-filesystem-ftpsockets.php | Creates a directory. |
unzip_file()wp-admin/includes/file.php | Unzips a specified ZIP file to a location on the filesystem via the WordPress Filesystem Abstraction. |
_unzip_file_ziparchive()wp-admin/includes/file.php | Attempts to unzip an archive using the ZipArchive class. |
_unzip_file_pclzip()wp-admin/includes/file.php | Attempts to unzip an archive using the PclZip library. |
register_theme_directory()wp-includes/theme.php | Registers a directory that contains themes. |
trailingslashit()wp-includes/formatting.php | Appends a trailing slash. |
_config_wp_home()wp-includes/functions.php | Retrieves the WordPress home page URL. |
_config_wp_siteurl()wp-includes/functions.php | Retrieves the WordPress site URL. |
WP_Widget_RSS::widget()wp-includes/widgets/class-wp-widget-rss.php | Outputs the content for the current RSS widget instance. |
get_pagenum_link()wp-includes/link-template.php | Retrieves the link for a page number. |
user_trailingslashit()wp-includes/link-template.php | Retrieves a trailing-slashed string if the site is set for adding trailing slashes. |
get_option()wp-includes/option.php | Retrieves an option value based on an option name. |
_wp_menu_item_classes_by_context()wp-includes/nav-menu-template.php | Adds the class property classes for the current context, if applicable. |
redirect_canonical()wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
wp_redirect_admin_locations()wp-includes/canonical.php | Redirects a variety of shorthand URLs to the admin. |
recurse_dirsize()wp-includes/functions.php | Gets the size of a directory recursively. |
install_blog()wp-includes/ms-deprecated.php | Install an empty blog. |
Changelog
Version | Description |
---|---|
2.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.