Huh. It had never actually occurred to me to use widget instance as cache. I hadn’t ever seen such implementation either.
This is quite an original idea, and as such it is hard to accurately point out benefits and issues with implementation. For starters update()
doesn’t actually save anything, it just used as check for actual save and I won’t say where saving even happens from quick look because it’s abstracted deeper.
From my experience the more traditional implementation would be to cache using more conventional approach (such as transients) and tie it to API, not to widget.
As argument for that imagine user puts two different instances of widget in two different sidebars, but configures them the same way. They will be polling API at double rate, while they actually need exactly same data from API and could (and should) share it.
Related Posts:
- How to save widget fields generated from an array?
- SELECT field options disappear when saving widget
- What is the quickest way to make a widget?
- Widget Options Not saving
- Indexes of widgets instances starts with ‘2’ in ‘wp_options’ table
- Complex widget form UI – examples and best practices
- Remove before_widget / after_widget content from Wp_Widget_Text
- Is It Possible to Restore Accidentally Deleted Widgets?
- How do I create a widget that only allows a single instance?
- Separate backend “Widgets” page for each language
- how to extend a WP_widget twice
- How to access widget data from outside widget?
- Defer Code in Widgets – Page Speed
- How does the default recent posts widget work with cache?
- Add new section to “Right Now” widget
- Creating a admin widget for /wp-admin/post.php?
- Creating a one click demo importer
- Custom widget select options needs to stay selected after save
- Why won’t my custom widget stay in the sidebar after a reload?
- Why does WordPress stores widget options in a multidimensional array?
- Warning: Creating default object… when altering Customize panels
- Remove image height/width attributes from Image Widget
- Extending WP_Widget throws error when Monster Widget used
- get_option returns undesired blank instance of a widget
- How to get options of all active widgets ?
- Add a specific css to a widget
- Save button is not working on custom widget
- Enabled checkbox by default in WordPress widgets
- accessing wordpress serialized data outside wp
- In widget, the value of select field doesn’t get updated, changes after saving
- Got a problem with a widget
- Problem with WP_Query loop and search term
- How to update the options table for a widget
- Widget settings disappear after refreshing page
- Use customizer or sidebar for header settings?
- Options page for widget
- Custom tabs widget don’t work in google chrome, is blocked, do not change the tabs. Why?
- Passing widget options to external script
- Widget options – where to put them?
- Extending Widgets – Exclude # of posts field from Recent Posts Widget
- How to translate widget titles in 2021 theme?
- How do I remove lazyloading on the mh-spotlight-widget
- Inject “fake” category to widget/block
- Add custom border across footer widget area
- Is it possible to add a preview to custom developed Widget?
- How to enable [archives] short code
- Can you hide a widget based on its content?
- Where does the removing of widget through appearance – customize take affect
- How do I add a small excerpt of a blog post on my Front Page Recent Posts widget?
- Widget editing returns JSON response error
- Allow users to give a dashboard widget a custom name using ACF
- Quick Draft widget in weird place on dashboard after being re-added
- How to change widget title in wordpress version 5.8.1?
- Extending the WordPress Recent Posts Widget
- WordPress 5.8 : display new widget
- delete widget upon uninstall
- Determine if a specific Gutenberg block is used on pages/posts
- WordPress 5.8 Beta 3 Widget Block: widget_id is undefined when a widget is placed
- Your theme has 8 widget areas, but this particular page doesn’t display them
- How to use register_sidebar’s ‘before_widget’ unique id generator into its other parameters like ‘before_title’?
- A message to clients in the dashboard widget received from another site
- Set a dashboard widget to the top?
- Display Most Recent Post Widget Title On Page
- Fatal error: Uncaught Error: Class ‘WP_Widget’ not found
- How do I make mysite.com/comingsoon WordPress to become my main website’s WordPress?
- Array showing all values of loop instead of specific value to post
- How to paste widget to a specific page
- How can I remove WordPress element IDs and Class names in the HTML?
- Remove widgets on mobile front page without affecting desktop
- Dynamic Bootstrap Carousel ID per widget on same page
- Inserting a class on before_widget if checkbox is checked
- How to get individual values from custom widget?
- How would you return a value from an individual field in a custom widget?
- Changing the CSS with a plugin
- Customize section does not show my widget areas
- Widget recent comment filter by post meta_value
- Need to delete the sidebar widget area and have the page a full page rather than just have a blank widget area
- How to decorate WP_Widget_Text?
- How do I find out which
- Widget not appearing in customizer
- After adding widget the style is messing up
- How do I get my custom widget to show on live site?
- Mobile view: how to remove right/left margin from the specific widgets?
- Unable to see Widget Submenu under Appearance with Class Based WP_Widget
- Widget display nothing
- How can I add a widget area to the top of the Dashboard?
- Tabs widget from Elementor is not showing the content in it to users. But at admin side it is working fine
- How could I change contact details in the footer?
- How to update a widget data?
- How can I have sidebar widgets on Twenty Seventeen theme on all pages?
- why the code html apear in this widget in footer
- Widgets are not displaying in my theme
- An archive widget, coming from nowhere on my posts and pages
- how to make video autoplay in widget
- save short-code in my custom plugin settings problem missed something
- Widget title showing below widget
- Elementor or WordPress randomly adds the word “array” to my custom widget
- Widget form not displaying for media widgets in WordPress
- Display Login user name in Thim:login Popup widget
- Make Widget appear on Dashboard