function update($new_instance, $old_instance) { if ($new_instance['post_shape'] == 'circle') { $new_instance['post_style'] = $new_instance['post_shape']; } elseif ($new_instance['post_shape'] == 'magazine') { $new_instance['post_style'] = $new_instance['magazine_style']; } else { $new_instance['post_style'] = $new_instance['hover_style']; } $new_instance['post_order'] = 'desc'; return parent::update($new_instance, $old_instance); }
public function update($new_instance, $old_instance) { $new_instance['ids'] = explode(',', $new_instance['ids']); return parent::update($new_instance, $old_instance); }
public function update($new_instance, $old_instance) { // this check can be done for other cases where a "row-fluid" class is needed if (isset($new_instance['map_background']) && '1' == $new_instance['map_background']) { //re-using a prehandled case for full-width sliders $new_instance['fullwidthSlider'] = 'full-width-column'; } else { if (!empty($new_instance['background_color']) || !empty($new_instance['image_upload']) || !empty($new_instance['checkParallax']) || !empty($new_instance['highlight']) || !empty($new_instance['center_blocks']) || !empty($new_instance['background_video'])) { $new_instance['fullwidthSlider'] = 'full-width-column'; } else { if (isset($new_instance['fullwidthSlider'])) { // make sure to unset it if we don't need it unset($new_instance['fullwidthSlider']); } } } return parent::update($new_instance, $old_instance); }
public function update($new_instance, $old_instance) { $new_instance['_data'] = (array) json_decode(wp_unslash($new_instance['_data']), true); return parent::update($new_instance, $old_instance); }