delete_user_setting( string $names ): bool|null  Deletes user interface settings.   Description Deleting settings would reset them to the defaults. This function has to be used before any output has started as it calls setcookie().   Parameters   $names string Required    The name or array of names of the setting to be deleted.      Return bool|null True if deleted successfully, false otherwise. Null if the current user is not a member of the site.   Source  File: wp-includes/option.php. View all references  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;
}
   Related  Uses    Uses Description      get_all_user_settings() wp-includes/option.php   Retrieves all user interface settings.     wp_set_all_user_settings() wp-includes/option.php   Private. Sets all user interface settings.   
   Used By    Used By Description      default_password_nag_handler() wp-admin/includes/user.php       default_password_nag_edit_user() wp-admin/includes/user.php     
    Changelog    Version Description     2.7.0 Introduced.    

    
{'path': 'public/docs/wordpress/functions/delete_user_setting.html', 'source': 'DevDocs.IO'}