Editor Widget Role
This needs to be implemented at the widget code level for which the code in the question you start with is not a good match. The easiest way might be to decouple the widget content editing and the widget placement. You can set up a specific page in which it is possible to manage the … Read more