wp_is_home_url_using_https() WordPress Function

The wp_is_home_url_using_https() function allows you to check if the home URL is using HTTPS. This can be useful for ensuring that your site is secure and for redirecting users to the correct URL if they are trying to access your site using an insecure connection.

wp_is_home_url_using_https() #

Checks whether the current site URL is using HTTPS.


Description

Top ↑

See also


Top ↑

Return

(bool) True if using HTTPS, false otherwise.


Top ↑

Source

File: wp-includes/https-detection.php

function wp_is_home_url_using_https() {
	return 'https' === wp_parse_url( home_url(), PHP_URL_SCHEME );
}


Top ↑

Changelog

Changelog
VersionDescription
5.7.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.