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.
Parameters
$valuestring
Value to which trailing slash will be added.
Return
string
String with trailing slash added.
Uses · 1
untrailingslashit()Removes trailing forward slashes and backslashes if they exist.
WP_Image_Editor::get_output_format()Returns preferred mime-type and extension based on provided file's extension and mime, or current file's extension and mime.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/formatting.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.