WordPress at a glance
function is not described

WP_Widget_Meta::update() WP 2.8.0

Handles updating settings for the current Meta widget instance.

This is a method of the class: WP_Widget_Meta

No Hooks.


Array. Updated settings to save.


$WP_Widget_Meta = new WP_Widget_Meta();
$var = $WP_Widget_Meta->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.


Since 2.8.0 Introduced.

Code of WP Widget Meta::update: wp-includes/widgets/class-wp-widget-meta.php WP 5.4.1

public function update( $new_instance, $old_instance ) {
	$instance          = $old_instance;
	$instance['title'] = sanitize_text_field( $new_instance['title'] );

	return $instance;