Title: [Plugin: WP Super Cache] Use function in a class with add_cacheaction
Last modified: August 19, 2016

---

# [Plugin: WP Super Cache] Use function in a class with add_cacheaction

 *  [Rickard Andersson](https://wordpress.org/support/users/exz/)
 * (@exz)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-use-function-in-a-class-with-add_cacheaction/)
 * Hi, and thank you for a great plugin.
 * I’ve created a patch for add_cacheaction so that you can send an array with class
   and function instead of just a function name, as it currently works in WordPress.
 * This enables plugin authors to hook into WP Super Cache with
 * `add_cacheaction( "...", array( $this, 'function' ) );`
 * I’ve done a quick search for more places where this change is needed and didn’t
   find any, but perhaps the plugin author can make those changes if this seems 
   like a reasonable change.
 * [http://montania.se/php/wp-super-cache.patch.txt](http://montania.se/php/wp-super-cache.patch.txt)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-use-function-in-a-class-with-add_cacheaction/#post-1822990)
 * Thanks, just checked that into trunk!
 *  Thread Starter [Rickard Andersson](https://wordpress.org/support/users/exz/)
 * (@exz)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-use-function-in-a-class-with-add_cacheaction/#post-1822992)
 * Cool, glad that I could help out!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: WP Super Cache] Use function in a class with add_cacheaction’
is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Rickard Andersson](https://wordpress.org/support/users/exz/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-use-function-in-a-class-with-add_cacheaction/#post-1822992)
 * Status: not a support question