wp_is_https_supported(): bool

In this article

Checks whether HTTPS is supported for the server and domain.

Description

This function makes an HTTP request through wp_get_https_detection_errors() to check for HTTPS support. As this process can be resource-intensive, it should be used cautiously, especially in performance-sensitive environments, to avoid potential latency issues.

Return

bool True if HTTPS is supported, false otherwise.

Source

function wp_is_https_supported() {
	$https_detection_errors = wp_get_https_detection_errors();

	// If there are errors, HTTPS is not supported.
	return empty( $https_detection_errors );
}

Changelog

VersionDescription
5.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.