WordPress at a glance
function is not described

WP_Widget_Categories::update() public WP 2.8.0

Handles updating settings for the current Categories widget instance.

{} It's a method of the class: WP_Widget_Categories{}

No Hooks.

Return

Array. Updated settings to save.

Usage

$WP_Widget_Categories = new WP_Widget_Categories();
$WP_Widget_Categories->update( $new_instance, $old_instance );
$new_instance(array) (required)
New settings for this instance as input by the user via WP_Widget::form().
$old_instance(array) (required)
Old settings for this instance.

Changelog

Since 2.8.0 Introduced.

Code of WP_Widget_Categories::update() WP 5.7.2

<?php
public function update( $new_instance, $old_instance ) {
	$instance                 = $old_instance;
	$instance['title']        = sanitize_text_field( $new_instance['title'] );
	$instance['count']        = ! empty( $new_instance['count'] ) ? 1 : 0;
	$instance['hierarchical'] = ! empty( $new_instance['hierarchical'] ) ? 1 : 0;
	$instance['dropdown']     = ! empty( $new_instance['dropdown'] ) ? 1 : 0;

	return $instance;
}