Codex tools: Log in
Contents |
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.
<?php force_ssl_login(); ?>
<?php if ( force_ssl_login() ) { echo 'Logins should be sent over SSL'; } ?>
<?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';
}
?>
<?php force_ssl_login(FORCE_SSL_LOGIN); ?>
Since: Wordpress 2.6.0
force_ssl_login() is located in wp-includes/functions.php.