I have a small widget which gets some information from other websites. Now, at times it is possible that these other websites are not available.
Is it possible to disable or hide a widget automatically (through the WP_Widget
class, i.e. in my code that extends it) whenever I detect an error? I don't wish to disable it permanently, I just don't want to have failures that break my page and at the same time I don't want to display things like 'Error retrieving data' or whatever... I just want to hide the widget all along.
WP_Widget
or some way. I don't know what I should give you because its just my code which is irrelevant for what I am asking. Just assume I have an error code from my function call...