wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



is_ssl › WordPress Function

Depuis2.6.0
Dépréciéen/a
is_ssl ( Pas de paramètres )
Retourne:
  • (bool) True if SSL, otherwise false.
Défini(e) dans:
Codex:
Changelog:
  • 4.6.0

Determines if SSL is used.



Fonctions en relation: is_single, is_rtl, filter_ssl, is_success, esc_sql

Source

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

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

	return false;
}