Example: when the home_url() function is used to fill the value for the href attr in a tag, for example the name of the site:
<h1><a href="<?php echo home_url(); ?>">
<?php bloginfo('name'); ?></a>
</h1>
With no $path parameter added to the function (‘/’) how does the trailing slash end up in the url after the link is clicked?
In the database, in the “home” record(wp_options table) there is no trailing slash at the end of the url: http://localhost/wordpress.
So, what’s going on?
Seems like a piece of functionality they asked for and implemented as a feature request:
https://core.trac.wordpress.org/ticket/13245
A quick fix would be to rtrim the slash character:
Hope this helps.