Unless you have a memcached-type plugin installed, wp_cache_set will only store data for the duration of the current script. Call or add the widget again in the same instance & you’ll see it utilise the cache.
As for ob_get_flush(), taken from the manual:
Flush the output buffer, return it as a string and turn off output buffering
In other words, it prints and returns the buffer at the same time.
Related Posts:
- What is the quickest way to make a widget?
- Widget Options Not saving
- Complex widget form UI – examples and best practices
- Remove before_widget / after_widget content from Wp_Widget_Text
- How to update widget from widget() function?
- Is It Possible to Restore Accidentally Deleted Widgets?
- How do I create a widget that only allows a single instance?
- how to extend a WP_widget twice
- Defer Code in Widgets – Page Speed
- Creating your own widgets: using cache?
- Add new section to “Right Now” widget
- Creating a admin widget for /wp-admin/post.php?
- Why won’t my custom widget stay in the sidebar after a reload?
- How to save widget fields generated from an array?
- Remove image height/width attributes from Image Widget
- Extending WP_Widget throws error when Monster Widget used
- Add a specific css to a widget
- Save button is not working on custom widget
- flush_widget_cache is deprecated. Which method should i use instead?
- Enabled checkbox by default in WordPress widgets
- Got a problem with a widget
- SELECT field options disappear when saving widget
- Problem with WP_Query loop and search term
- Custom php Widget keeps disappearing from the front end
- Custom tabs widget don’t work in google chrome, is blocked, do not change the tabs. Why?
- Extending Widgets – Exclude # of posts field from Recent Posts Widget
- Programmatically add widgets to sidebars
- changing wp-admin/widgets.php
- dynamically add scripts to WP_Widget widget() method
- Get Widget Instance inside Widget
- How do i manually place a widget code
- How to Validate Widget Input
- How to avoid widgets added to sidebar on theme activation?
- How Can A Widget With Only One Instance Be Defined?
- Display specific widgets in different area’s around the page
- /images/image.jpg not working in sidebar
- Unable to save widget contents
- Use wp_enqueue_style based on user option in widget
- parse json object and display live in wordpress php widget
- Creating a one click demo importer
- How to get sidebar’s content inside admin-ajax?
- Updating Widget options in custom install.php
- passing variables inside a widget add_action
- How do you create dynamic customised sections in WordPress?
- Run JS after widget settings are saved?
- Text Widget Links Not Working
- Display the id list of active widgets of same sidebar?
- How to remove a widget from the sidebar on specific page?
- Where do I save widget code for wordpress?
- Is there any way to print a widget by having its id?
- How to add just one specific page to widget without plugin?
- Warning: Creating default object… when altering Customize panels
- Need help using a filter on the default Categories widget
- How to display an RSS feed widget inside a page?
- widget dropdown menu code
- Do widget options need to be escaped widget()?
- isSavingPost() for widgets
- Allow a Widget to be used one time only?
- Content of widgets keep disappearing over and over again
- custom widget does not saved value
- php to add a link into wp widget without specific url
- Widget Select Options not saving
- How to activate WordPress widgets but not display?
- Insert widgets into loop/custom query at every nth position
- Twenty Fourteen: how do they populate by default the sidebar?
- WordPress widget not appearing in editors widget list
- How to insert widgets into a post?
- Widget’s Content Mssing in Child Theme
- My widget not printing before_widgets and after widgets
- wrapper div for widgets not showing with all widgets
- Address automatically generated ids in css [closed]
- Check if widget is inside sidebar with PHP
- latest posts-widget displays all posts on archive page but works great anywhere else
- Customise the Category Widget
- Widget : html 2 dimensional array doesn’t work
- call widget from within shortcode
- How long is “as long as possible” in wp_cache_set()?
- How to get class from widget area
- In widget, the value of select field doesn’t get updated, changes after saving
- Removing widget without using unregister_widget
- Editing Help Section
- WordPress text filed input only inter value?
- Need to delete the sidebar widget area and have the page a full page rather than just have a blank widget area
- Searching for a one page overview widget
- How do I add after the tag in WordPress widget?
- Creating a simple button inside of a widget
- The WP_Widget class seems to run many times on a page load
- Stop ‘extends WP_Widget’ displaying the (backend) form, frontend?
- How to check widget-cpt meta and display its custom css in the head?
- How to add WooCommerce Add to Cart button in widget?
- How to call theme default widget in custom template?
- How to place a widget beside a div/text so that they display as a continuous line
- Editor Widget Role
- How to Activate WordPress Widgets
- WordPress wiget admin panel
- Filter “widget_comments_args” won’t work
- How to output built-in widgets with number in range as class?
- How to hide sidebar widgets in all pages except Hompage?
- How can I create my own widgets in WordPress? [closed]
- How to insert a block in a widget which links to a entry/page