Widget instance options not showing correctly
i finally found the answer, its actually not a problem with the code i posted. its in the update() function. i have some validation code function update($new_instance, $old_instance) { $instance[‘title’] = esc_attr(strip_tags($new_instance[‘title’])); if (is_int($new_instance[‘number_products’])) { if ($new_instance[‘number_products’] > 0) $instance[‘number_products’] = $new_instance[‘number_products’]; else $instance[‘number_products’] = 1; } else { $instance[‘number_products’] = $old_instance[‘number_product’]; } return $instance; … Read more