WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/filter SSL

Description

Filters a URL and formats it as https if necessary (is_ssl() and force_ssl_content() are both true).

Usage

<?php filter_SSL$url ?>

Parameters

$url
(string) (required) The URL to format
Default: None

Return Value

(string) 
The formatted URL

Examples

<?php

$url = 'http://example.com/';

$url = filter_SSL( $url );

echo $url; // 'https://example.com/' or 'http://example.com/' as needed.

?>

Notes

  • If $url is not a string, the Site Address is returned.
  • Uses set_url_scheme() to set the scheme to https when needed.

Change Log

Since: 2.8.5

Source File

filter_SSL() is located in wp-includes/ms-functions.php

Related

set_url_scheme(), is_ssl(), force_ssl_content()

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.