This page redirects to an external site: https://developer.wordpress.org/reference/functions/force_ssl_admin/
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.
<code style="color: #000000"> <span style="color: #0000BB"><?php force_ssl_admin</span><span style="color: #007700">(); </span><span style="color: #0000BB">?></span> </code>
<code style="color: #000000"> <span style="color: #0000BB"><?php </span><span style="color: #007700">if ( </span><span style="color: #0000BB">force_ssl_admin</span><span style="color: #007700">() ) { echo </span><span style="color: #DD0000">'Administration should be performed over SSL'</span><span style="color: #007700">; } </span><span style="color: #0000BB">?></span> </code>
<code style="color: #000000"> <span style="color: #0000BB"><?php
force_ssl_admin</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">);
if ( </span><span style="color: #0000BB">force_ssl_admin</span><span style="color: #007700">() ) {
echo </span><span style="color: #DD0000">'Administration should be performed over SSL'</span><span style="color: #007700">;
} else {
echo </span><span style="color: #DD0000">'This code will never execute'</span><span style="color: #007700">;
}
</span><span style="color: #0000BB">force_ssl_admin</span><span style="color: #007700">(</span><span style="color: #0000BB">false</span><span style="color: #007700">);
if ( </span><span style="color: #0000BB">force_ssl_admin</span><span style="color: #007700">() ) {
echo </span><span style="color: #DD0000">'This code will never execute'</span><span style="color: #007700">;
} else {
echo </span><span style="color: #DD0000">'Administration should NOT be performed over SSL'</span><span style="color: #007700">;
}
</span><span style="color: #0000BB">?></span> </code>
<code style="color: #000000"> <span style="color: #0000BB"><?php force_ssl_admin</span><span style="color: #007700">(</span><span style="color: #0000BB">FORCE_SSL_ADMIN</span><span style="color: #007700">); </span><span style="color: #0000BB">?></span> </code>
Since: 2.6.0
force_ssl_admin() is located in wp-includes/functions.php.