use_ssl_preference() WordPress Function

The use_ssl_preference() function allows a user to set their preferred SSL setting for their account. The function can be used to set the preferred SSL setting to either "ssl" or "no ssl".

use_ssl_preference( WP_User $user ) #

Optional SSL preference that can be turned on by hooking to the ‘personal_options’ action.


Description

See the ‘personal_options’ action.


Top ↑

Parameters

$user

(WP_User)(Required)User data object.


Top ↑

Source

File: wp-admin/includes/user.php

function use_ssl_preference( $user ) {
	?>
	<tr class="user-use-ssl-wrap">
		<th scope="row"><?php _e( 'Use https' ); ?></th>
		<td><label for="use_ssl"><input name="use_ssl" type="checkbox" id="use_ssl" value="1" <?php checked( '1', $user->use_ssl ); ?> /> <?php _e( 'Always use https when visiting the admin' ); ?></label></td>
	</tr>
	<?php
}


Top ↑

Changelog

Changelog
VersionDescription
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.