wp_is_https_supported() WordPress Function

The wp_is_https_supported() function is used to check if the server supports HTTPS. This is useful for checking if you can use HTTPS to connect to the WordPress site.

wp_is_https_supported() #

Checks whether HTTPS is supported for the server and domain.


Return

(bool) True if HTTPS is supported, false otherwise.


Top ↑

Source

File: wp-includes/https-detection.php

function wp_is_https_supported() {
	$https_detection_errors = get_option( 'https_detection_errors' );

	// If option has never been set by the Cron hook before, run it on-the-fly as fallback.
	if ( false === $https_detection_errors ) {
		wp_update_https_detection_errors();

		$https_detection_errors = get_option( 'https_detection_errors' );
	}

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


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.