When adding new widget instance, use isset() to make sure setting key exists and avoid notices/warnings.

This commit is contained in:
Scott Basgaard 2013-11-13 21:03:46 -05:00
parent eb91907db6
commit c36369010d
1 changed files with 2 additions and 1 deletions

View File

@ -82,6 +82,7 @@ abstract class WC_Widget extends WP_Widget {
return $instance;
foreach ( $this->settings as $key => $setting ) {
if ( isset( $new_instance[$key] ) )
$instance[ $key ] = sanitize_text_field( $new_instance[ $key ] );
}