Skip to content

Instantly share code, notes, and snippets.

@Rarst
Last active December 16, 2015 22:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rarst/5505035 to your computer and use it in GitHub Desktop.
Save Rarst/5505035 to your computer and use it in GitHub Desktop.
Additional items for A Fresher Cache WP plugin: APC, plugin/themes updates.
<?php
add_action( 'init', function () {
if ( ! function_exists( 'afc_add_item' ) || ! function_exists( 'apc_clear_cache' ) ) {
return;
}
afc_add_item( array(
'id' => 'apc',
'title' => 'APC',
'no_href' => true,
) );
afc_add_item( array(
'id' => 'apc-system',
'parent' => 'apc',
'title' => 'System',
'function' => 'apc_clear_cache',
'capability' => 'manage_options',
) );
afc_add_item( array(
'id' => 'apc-user',
'parent' => 'apc',
'title' => 'User',
'function' => 'apc_clear_cache',
'args' => array( 'user' ),
'capability' => 'manage_options',
) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment