Support » Plugins and Hacks » Calling the Delete method of WP Super Cache from a PHP script

  • I am building some forms into a template that would change custom fields for a page on our company intranet. I would like to delete the cache whenever an administrator submits the form so that when the page reloads, it will show the new value of the custom field.

    Is there a way to delete the cache from a php script? It looks like I could call wp_cache_clean_expired from the php script, but I haven’t found any documentation on using this function for that purpose.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can try the following:
    prune_super_cache( $blog_cache_dir, true );
    prune_super_cache( $cache_path . ‘supercache/’, true );

    I’m going to add a new function, wp_cache_clear_cache() that will call those functions but in the current version you have to use the 2 functions above.

    That did the trick.
    Thank you donncha!

    I’m curious, will the new function have any parameters?

    No, check out the development version on the download page. You’ll find the function already there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Calling the Delete method of WP Super Cache from a PHP script’ is closed to new replies.