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

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-maximum-price-filter.php

	public function update( $new_instance, $old_instance ) {
		$instance          = array();
		$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? wp_strip_all_tags( $new_instance['title'] ) : '';
		if ( is_string( $new_instance['prices'] ) ) {
			$new_instance['prices'] = explode( ',', $new_instance['prices'] );
		}
		$instance['prices']             = ( ! empty( $new_instance['prices'] ) ) ? array_map( 'intval', $new_instance['prices'] ) : $this->price_defaults;
		$instance['display_type']       = ( ! empty( $new_instance['display_type'] ) ) ? wp_strip_all_tags( $new_instance['display_type'] ) : '';
		$instance['orientation']        = ( ! empty( $new_instance['orientation'] ) ) ? wp_strip_all_tags( $new_instance['orientation'] ) : '';
		$instance['cb_reset_link_only'] = ( ! empty( $new_instance['cb_reset_link_only'] ) ) ? $new_instance['cb_reset_link_only'] : '';
		return $instance;
	}