$this->
start_capturing_option_updates();
$parsed_id =
$this->
parse_widget_id( $widget_id );
$option_name = 'widget_' .
$parsed_id['id_base'
];
/*
* If a previously-sanitized instance is provided, populate the input vars
* with its values so that the widget update callback will read this instance
*/
$added_input_vars = array
();
if ( !
empty( $_POST['sanitized_widget_setting'
] ) ) { $sanitized_widget_setting =
json_decode( $this->
get_post_value( 'sanitized_widget_setting'
), true
);
if ( false ===
$sanitized_widget_setting ) { $this->
stop_capturing_option_updates();
return new WP_Error( 'widget_setting_malformed'
);
} $instance =
$this->
sanitize_widget_instance( $sanitized_widget_setting,
$parsed_id['id_base'
] );
if ( is_null( $instance ) ) { $this->
stop_capturing_option_updates();
return new WP_Error( 'widget_setting_unsanitized'
);
}