WordPress at Your Fingertips

wp_is_using_https() WP 1.0

Checks whether the website is using HTTPS.

This is based on whether both the home and site URL are using HTTPS.

1 time — 0.0034051 sec (very slow) | 50000 times — 7.82 sec (fast) | PHP 7.4.8, WP 5.7.1

No Hooks.

Return

true|false. True if using HTTPS, false otherwise.

Usage

wp_is_using_https();

Notes

Changelog

Since 5.7.0 Introduced.

Code of wp_is_using_https() WP 5.8.1

function wp_is_using_https() {
	if ( ! wp_is_home_url_using_https() ) {
		return false;
	}

	return wp_is_site_url_using_https();
}

Conditional tags (all)

No comments
    Log In