WordPress.org

Codex

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

Function Reference/force ssl login


This function has been deprecated since Version 4.4. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use force_ssl_admin instead.

Description

Determine whether the login page should be viewed over SSL. This function relies on the FORCE_SSL_LOGIN 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.

Usage

 <?php force_ssl_login(); ?> 

Default Usage

 <?php if ( force_ssl_login() ) { echo 'Logins should be sent over SSL'; } ?> 

Changing the Return Value

 <?php
force_ssl_login
(true);
if ( 
force_ssl_login() ) {
  echo 
'Logins should be sent over SSL';
} else {
  echo 
'This code will never execute';
}
force_ssl_login(false);
if ( 
force_ssl_login() ) {
  echo 
'This code will never execute';
} else {
  echo 
'Logins should NOT be sent over SSL';
}
?> 

Resetting the Return Value

 <?php force_ssl_login(FORCE_SSL_LOGIN); ?> 

Parameters

$force
(boolean) (optional) If provided, the return value will be reset to this value on the next call.
Default: None

Returns

(boolean) 
True if the login form should be submitted over SSL, false otherwise

Changelog

Since: Wordpress 2.6.0

Source Code

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

Related

force_ssl_admin()

force_ssl_content()

Administration_Over_SSL

See also index of Function Reference and index of Template Tags.