WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Widget_Text::update() public WP 2.8.0

Handles updating settings for the current Text widget instance.

Это метод класса: WP_Widget_Text{}

Хуков нет.

Возвращает

Массив. Settings to save or bool false to cancel saving.

Использование

$WP_Widget_Text = new WP_Widget_Text();
$WP_Widget_Text->update( $new_instance, $old_instance );
$new_instance(массив) (обязательный)
New settings for this instance as input by the user via WP_Widget::form().
$old_instance(массив) (обязательный)
Old settings for this instance.

Список изменений

С версии 2.8.0 Введена.

Код WP_Widget_Text::update() WP 5.5.1

wp-includes/widgets/class-wp-widget-text.php
<?php
public function update( $new_instance, $old_instance ) {
	$new_instance = wp_parse_args(
		$new_instance,
		array(
			'title'  => '',
			'text'   => '',
			'filter' => false, // For back-compat.
			'visual' => null,  // Must be explicitly defined.
		)
	);

	$instance = $old_instance;

	$instance['title'] = sanitize_text_field( $new_instance['title'] );
	if ( current_user_can( 'unfiltered_html' ) ) {
		$instance['text'] = $new_instance['text'];
	} else {
		$instance['text'] = wp_kses_post( $new_instance['text'] );
	}

	$instance['filter'] = ! empty( $new_instance['filter'] );

	// Upgrade 4.8.0 format.
	if ( isset( $old_instance['filter'] ) && 'content' === $old_instance['filter'] ) {
		$instance['visual'] = true;
	}
	if ( 'content' === $new_instance['filter'] ) {
		$instance['visual'] = true;
	}

	if ( isset( $new_instance['visual'] ) ) {
		$instance['visual'] = ! empty( $new_instance['visual'] );
	}

	// Filter is always true in visual mode.
	if ( ! empty( $instance['visual'] ) ) {
		$instance['filter'] = true;
	}

	return $instance;
}