user_trailingslashit WordPress Filter Hook

The user_trailingslashit hook is used to add a trailing slash to any URL that does not already have one. This is useful for making sure that your URLs are always consistent, and can help to avoid some potential problems with links.

apply_filters( 'user_trailingslashit', string $string, string $type_of_url ) #

Filters the trailing-slashed string, depending on whether the site is set to use trailing slashes.


Parameters

$string

(string)URL with or without a trailing slash.

$type_of_url

(string)The type of URL being considered. Accepts 'single', 'single_trackback', 'single_feed', 'single_paged', 'commentpaged', 'paged', 'home', 'feed', 'category', 'page', 'year', 'month', 'day', 'post_type_archive'.


Top ↑

Source

File: wp-includes/link-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More