/** * OVERRIDE: Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form($instance) { // $instance['image'] should be a media['ID'], but due to // https://github.com/proudcity/wp-proudcity/issues/436 // Old values may be [featured-image] // Set new value 'featured_image' if that is the case if (!empty($instance['image']) && $instance['image'] === '[featured-image]') { $instance['featured_image'] = 'yes'; } parent::form($instance); }