On this page
delete_all_user_settings()
Deletes the user settings of the current user.
Source
File: wp-includes/option.php. View all references
function delete_all_user_settings() {
$user_id = get_current_user_id();
if ( ! $user_id ) {
return;
}
update_user_option( $user_id, 'user-settings', '', false );
setcookie( 'wp-settings-' . $user_id, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH );
}
Related
Uses
| Uses | Description |
|---|---|
| update_user_option() wp-includes/user.php | Updates user option with global blog capability. |
| get_current_user_id() wp-includes/user.php | Gets the current user’s ID. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/delete_all_user_settings