set_url_scheme WordPress Filter Hook

The set_url_scheme hook is used to set the scheme for a URL. The scheme determines the protocol used to access the URL, and can be set to either http or https. This hook is typically used to force a URL to use the https scheme, for security reasons.

apply_filters( 'set_url_scheme', string $url, string $scheme, string|null $orig_scheme ) #

Filters the resulting URL after setting the scheme.


Parameters

$url

(string)The complete URL including scheme and path.

$scheme

(string)Scheme applied to the URL. One of 'http', 'https', or 'relative'.

$orig_scheme

(string|null)Scheme requested for the URL. One of 'http', 'https', 'login', 'login_post', 'admin', 'relative', 'rest', 'rpc', or null.


Top ↑

Source

File: wp-includes/link-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.4.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
Show More