filter_SSL() WordPress Function

The filter_SSL() WordPress function allows for content to be filtered through a Secure Sockets Layer (SSL) connection. This is useful for ensuring that sensitive data is transmitted securely between a user and a website. SSL is a protocol that provides a secure channel for communication between two computers.

filter_SSL( string $url ) #

Formats a URL to use https.


Description

Useful as a filter.


Top ↑

Parameters

$url

(string)(Required)URL


Top ↑

Return

(string) URL with https as the scheme


Top ↑

Source

File: wp-includes/ms-functions.php

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;
}


Top ↑

Changelog

Changelog
VersionDescription
2.8.5Introduced.

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.

Show More
Show More