is_ssl()

Determines if SSL is used.


Return

(bool) True if SSL, otherwise false.


Source

File: wp-includes/load.php

function is_ssl() {
	if ( isset( $_SERVER['HTTPS'] ) ) {
		if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) {
			return true;
		}

		if ( '1' == $_SERVER['HTTPS'] ) {
			return true;
		}
	} elseif ( isset($_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
		return true;
	}
	return false;
}


Changelog

Changelog
Version Description
WP-4.6.0 Moved from functions.php to load.php.
WP-2.6.0 Introduced.