How to delete cached transients from a widget instance properly?
Use a widget cache and forget the actual number of active widgets. In your widget add this to your method widget(): public function widget( $args, $instance ) { // get the cache $cache = wp_cache_get( ‘UNIQUE_WIDGET_IDENTIFIER’, ‘widget’ ); if ( !is_array( $cache ) ) $cache = array(); if ( ! isset ( $args[‘widget_id’] ) ) … Read more