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

update


Description Description

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


Top ↑

Parameters Parameters

$new_instance

(array) (Required)

$old_instance

(array) (Required)


Top ↑

Return Return

(array) The updated array full of settings


Top ↑

Source Source

File: includes/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;
	}