use_ssl_preference

函式
use_ssl_preference ( $user )
引數
  • (WP_User) $user User data object.
    Required:
定義位置
相關方法
update_post_parent_cachescheck_ajax_refererget_status_header_descset_current_screenwp_register_persisted_preferences_meta
引入
2.7.0
棄用
-

use_ssl_preference: 這個函式檢查使用者是否設定了在網站上使用SSL的偏好。

可選的SSL偏好,可以通過掛鉤’personal_options’動作來開啟。

參見{@see ‘personal_options’}動作。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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
}
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 }
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
}

常見問題

FAQs
檢視更多 >