Inventory_Presser_Fuel_Economy_Widget::update( array $new_instance, array $old_instance )

update


Description

Saves the widget settings when a dashboard user clicks the Save button.


Parameters

$new_instance

(array) (Required)

$old_instance

(array) (Required)


Return

(array) The updated array full of settings


Source

File: includes/widget/class-widget-fuel-economy.php

	public function update( $new_instance, $old_instance ) {
		$instance          = array();
		$instance['title'] = sanitize_text_field( $new_instance['title'] );
		if ( ! empty( $new_instance['include_annual_stats'] ) ) {
			$instance['include_annual_stats'] = 'true';
		}
		return $instance;
	}