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



filter_ssl › WordPress Function

Depuis2.8.5
Dépréciéen/a
filter_ssl ( $url )
Paramètres:
  • (string) $url URL.
    Requis: Oui
Retourne:
  • (string) URL with https as the scheme.
Défini(e) dans:
Codex:

Formats a URL to use https.

Useful as a filter.


Source

function filter_SSL( $url ) {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	if ( ! is_string( $url ) ) {
		return get_bloginfo( 'url' ); // Return home site URL with proper scheme.
	}

	if ( force_ssl_content() && is_ssl() ) {
		$url = set_url_scheme( $url, 'https' );
	}

	return $url;
}