user_trailingslashit

SummerySummery

Retrieves a trailing-slashed string if the site is set for adding trailing slashes.

Syntax

user_trailingslashit( string $string, string $type_of_url = '' )

DescriptionDescription

Conditionally adds a trailing slash if the permalink structure has a trailing slash, strips the trailing slash if not. The string is passed through the ‘user_trailingslashit’ filter. Will remove trailing slash from string, if site is not set to have them.

ParametersParameters

$string

(string) (Required) URL with or without a trailing slash.

$type_of_url

(string) (Optional) The type of URL being considered (e.g. single, category, etc) for use in the filter.

Default value: ''

ReturnReturn

(string) The URL with the trailing slash appended or stripped.

SourceSource

File: wp-includes/link-template.php


			

ChangelogChangelog

Changelog
Version Description
2.2.0 Introduced.
Scroll to Top