force_ssl_content() WordPress Function
If you're running a website on WordPress and want to make sure your content is always served over a secure connection, you can use the force_ssl_content() function. This function will redirect all HTTP requests for your website to HTTPS, ensuring that your content is always encrypted.
force_ssl_content( bool $force = '' ) #
Determines whether to force SSL on content.
Parameters
- $force
(bool)(Optional)
Default value: ''
Return
(bool) True if forced, false if not forced.
Source
File: wp-includes/ms-functions.php
function force_ssl_content( $force = '' ) {
static $forced_content = false;
if ( ! $force ) {
$old_forced = $forced_content;
$forced_content = $force;
return $old_forced;
}
return $forced_content;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.8.5 | Introduced. |