Hello,
The logic should work. There is just a small typo in your code. In the response, the param should be id
instead of id:
.
However, loading selected posts to show after updating is the next problem. We need to update options
parameter to make the field renders properly. So, I added 2 more functions to get the saved data and put them in the options
:
https://pastebin.com/QNdW8cty