A Fresher Cache

Get a fresher cache with a dash of "A Fresher Cache" for absolutely no cash.

Author:tollmanz (profile at wordpress.org)
WordPress version required:3.3
WordPress version tested:3.9.40
Plugin version:0.1.2
Added to WordPress repository:29-05-2012
Last updated:01-07-2014
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:1
Plugin URI:http://github.com/tollmanz/a-fresher-cache
Total downloads:10 660
Active installs:30+
plugin download
Click to start download

A Fresher Cache adds an admin bar menu that gives easy access to functions that refresh (i.e, regenerate or invalidate)
cached items. Out of the box, the plugin provides easy access to refresh items that WordPress Core caches; however, the true
power of the plugin is its API that allows developers to easily add items to the menu that initiate custom functions that
refresh cached items.

For instance, imagine that you wrote a function called “my_update_all_term_caches” that loops through all of the terms
in your WordPress install and updates the cache for each item. You can add this function to the “Freshen” admin bar
menu with the following API call:

function my_update_all_term_caches_menu_item() {
    $args = array(
        'id' => 'my-update-all-term-caches',
        'title' => 'Update Term Cache',
        'function' => 'my_update_all_term_caches'
    );

    afc_add_item( $args );
}
add_action( 'init', 'my_update_all_term_caches_menu_item' );

This code will generate a menu item labelled “Update Term Cache” that creates a link that will run the function defined
in the “function” key of the $args array (in this case, my_update_all_term_caches()).

The primary purpose of this plugin is to provide an easy tool for developers to refresh cached items when developing new
features. Additionally, it can serve as a convenient tool for users to be able to update cached items when needed.

Note that this is not merely a wrapper for the admin bar API. Rather, it allows you to add items to the admin bar and provides
all of the necessary coding that will link a callback function to a menu item. You can think of it as an extension of
the admin bar that adds a very specific functionality. The plugin also uses the admin bar as intended and only adds a
few extra arguments that support the functionality of this plugin.

A more complete tutorial that describes the full functionality of the plugin can be read at
tollmanz.com.


Screenshots
FAQ
ChangeLog