On this page
force_ssl_admin( string|bool $force = null ): bool
Determines whether to force SSL used for the Administration Screens.
Parameters
$forcestring|bool Optional-
Whether to force SSL in admin screens.
Default:
null
Return
bool True if forced, false if not forced.
More Information
Determine whether the administration panel should be viewed over SSL. This function relies on the FORCE_SSL_ADMIN constant that is set in the wp-config.php file if you’re using your site over SSL.
The force parameter will change the return value of this function until it is reset.
Source
File: wp-includes/functions.php. View all references
function force_ssl_admin( $force = null ) {
static $forced = false;
if ( ! is_null( $force ) ) {
$old_forced = $forced;
$forced = $force;
return $old_forced;
}
return $forced;
}
Related
Used By
| Used By | Description |
|---|---|
| get_rest_url() wp-includes/rest-api.php | Retrieves the URL to a REST endpoint on a site. |
| auth_redirect() wp-includes/pluggable.php | Checks if a user is logged in, if not it redirects them to the login page. |
| force_ssl_login() wp-includes/deprecated.php | Whether SSL login should be forced. |
| wp_ssl_constants() wp-includes/default-constants.php | Defines SSL-related WordPress constants. |
| set_url_scheme() wp-includes/link-template.php | Sets the scheme for a URL. |
Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/force_ssl_admin