public function update($new_instance, $old_instance)
    {
        $instance = $old_instance;

        // Get vars
        foreach ($new_instance as $k => $i) {
            $instance[$k] = isset($new_instance[$k]) ? strip_tags($new_instance[$k]) : false;
        }

        // Flush current widget cache.
        $this->flush_widget_cache();

        // Get options from cache to renew them.
        $alloptions = wp_cache_get('alloptions', 'options');

        // Delete options.
        if (isset($alloptions[$this->getModel()->getIdentifier()])) {
            delete_option($this->getModel()->getIdentifier());
        }

        // Return new data.
        return $instance;
    }
public function update($new_instance, $old_instance)
    {
        $instance = $old_instance;

        // Get vars
        foreach ($new_instance as $k => $i) {
            $instance[$k] = isset($new_instance[$k]) ? strip_tags($new_instance[$k]) : false;
        }

        // Flush current widget cache.
        $this->flush_widget_cache();

        // Get options from cache to renew them.
        $alloptions = wp_cache_get('alloptions', 'options');

        // Delete options.
        if (isset($alloptions[$this->getModel()->getIdentifier()])) {
            delete_option($this->getModel()->getIdentifier());
        }

        // Return new data.
        return $instance;
    }
public function update ( $ new_instance , $ old_instance ) { $ instance = $ old_instance ; // Get vars foreach ( $ new_instance as $ k => $ i ) { $ instance [ $ k ] = isset ( $ new_instance [ $ k ] ) ? strip_tags ( $ new_instance [ $ k ] ) : false ; } // Flush current widget cache. $ this -> flush_widget_cache ( ) ; // Get options from cache to renew them. $ alloptions = wp_cache_get ( 'alloptions' , 'options' ) ; // Delete options. if ( isset ( $ alloptions [ $ this -> getModel ( ) -> getIdentifier ( ) ] ) ) { delete_option ( $ this -> getModel ( ) -> getIdentifier ( ) ) ; } // Return new data. return $ instance ; }
Deals with the settings when they are saved by the admin. Here is
where any validation should be dealt with.

@param array $new_instance
@param array $old_instance
@return array $instance
Deals with the settings when they are saved by the admin . Here is where any validation should be dealt with .