in your code $widget_id
has no value. I’m not sure where to get it from in this context but it should be an argument in either $args
or $instance
. I’ve done some looking, and even looking and it’s hard to tell I think it may be $instance->id
but I’m not sure