delete_all_user_settings()WP 2.7.0

Deletes the user settings of the current user.

No Hooks.

Return

null. Nothing (null).

Usage

delete_all_user_settings();

Changelog

Since 2.7.0 Introduced.

delete_all_user_settings() code WP 6.6.2

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 );
}