WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/force ssl login

Contents

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.