When adding new widget instance, use isset() to make sure setting key exists and avoid notices/warnings.
This commit is contained in:
parent
eb91907db6
commit
c36369010d
|
@ -82,6 +82,7 @@ abstract class WC_Widget extends WP_Widget {
|
||||||
return $instance;
|
return $instance;
|
||||||
|
|
||||||
foreach ( $this->settings as $key => $setting ) {
|
foreach ( $this->settings as $key => $setting ) {
|
||||||
|
if ( isset( $new_instance[$key] ) )
|
||||||
$instance[ $key ] = sanitize_text_field( $new_instance[ $key ] );
|
$instance[ $key ] = sanitize_text_field( $new_instance[ $key ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue