Yes, I know this is a bugbear to most plugin developers, and frankly - I’m surprised there isn’t more of an uproar about the lack of this most basic of all basic functions. But I am curious - has anyone worked out a way to achieve this?
I have a plugin that retrieves data, and has a configurable boolean input (dynamic), that determines if the element retrieves data or not. This works fine, EXCEPT on initial page load - where the property is completely ignored, since there is no way to get the value I know of. I currently retrieve that property during the update routine, which only occurs after page load. The way I see it, due to the lack of this capability - I have 4 options and they are all terrible:
- Change the default (currently false) to true - to allow data retrieval on first load.
- Create a separate element to handle the true vs. false use case.
- Use a shared key to determine the global behaviour of the plugin.
- Create some REALLY hacky solution that somehow causes the update routine to run immediately after the initialisation, to force the properties to be retrieved.
As above, I agree these are all terrible options - but without this most basic functionality, I am really lost in terms of how to achieve this…