Un motore di ricerca WordPress per sviluppatori e autori di temi



filter_ssl ›

Da2.8.5
Deprecaton/a
filter_ssl ( $url )
Parametri:
  • (string) $url URL
    Richiesto:
Ritorna:
  • (string) URL with https as the scheme
Definito a:
Codex:

Formats a URL to use https.

Useful as a filter.



Sorgenti

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

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

	return $url;
}