wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
delete_user_setting › WordPress Function
Depuis2.7.0
Dépréciéen/a
› delete_user_setting ( $names )
Paramètres: |
|
Retourne: |
|
Défini(e) dans: |
|
Codex: |
Deletes user interface settings.
Deleting settings would reset them to the defaults. This function has to be used before any output has started as it callssetcookie()
.Fonctions en relation: delete_all_user_settings, get_user_setting, set_user_setting, delete_user_option, delete_user_meta
Source
function delete_user_setting( $names ) { if ( headers_sent() ) { return false; } $all_user_settings = get_all_user_settings(); $names = (array) $names; $deleted = false; foreach ( $names as $name ) { if ( isset( $all_user_settings[ $name ] ) ) { unset( $all_user_settings[ $name ] ); $deleted = true; } } if ( $deleted ) { return wp_set_all_user_settings( $all_user_settings ); } return false; }