0

I am developing a plugin that displays your average Google My Business rating in a widget. Everything works fine, except when I close the widgets page and return to it later (or do a plain refresh) I cannot edit the widget settings anymore i.e. they dissappear. The only options that remain are remove and save.

When widget is added it looks normal. Settings are viewable (sorry, I can't add image, because I am only allowed to add two links, due to my lack of reputation. :P)

And after I close and return later or refresh the page it looks like this:

When I close or refresh the page it looks like this.

I have been digging through my code, but I haven't been able to locate the problem. The funny thing is, if I setup the plugin it functions fine. The settings are saved and on the front end it shows the widget as it is supposed to. Only after a page refresh or revisit the settings disappear and the settings are lost. What did I miss?

The widgets consists of three files, which are included in the main file.

You can view the code of all files on github: https://github.com/Dan0sz/google-my-business-reviews

1 Answer 1

0

Changing the include_once within form() to require solved the bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.