Codex tools: Log in
Contents |
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.
<?php force_ssl_admin(); ?>
<?php if ( force_ssl_admin() ) { echo 'Administration should be performed over SSL'; } ?>
<?php
force_ssl_admin(true);
if ( force_ssl_admin() ) {
echo 'Administration should be performed over SSL';
} else {
echo 'This code will never execute';
}
force_ssl_admin(false);
if ( force_ssl_admin() ) {
echo 'This code will never execute';
} else {
echo 'Administration should NOT be performed over SSL';
}
?>
<?php force_ssl_admin(FORCE_SSL_ADMIN); ?>
Since: Wordpress 2.6.0
force_ssl_admin() is located in wp-includes/functions.php.