WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
How to clear cache of a custom taxonomy? (4 posts)

  1. niska
    Member
    Posted 1 year ago #

    I know it is possible to programatically clear the cache for a single page/post by using w3tc_pgcache_flush_post($post_id). But how do I do it for a category, tag or a custom taxonomy?

    Please help

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. niska
    Member
    Posted 1 year ago #

    My temporary solution is to add this code into the flush_post function within PgCacheFlush.php

    w3_rmdir($cache->_cache_dir . '/gratis');

    I really wish that there were some kind of filter that I could use instead. Maby something for a future version?

  3. niska
    Member
    Posted 1 year ago #

    I just updated to 3.5.1 and my solution (above) now gives an error. What could be wrong?

  4. niska
    Member
    Posted 1 year ago #

    It seems as _cache_dir is no longer available, so I had to hard code the path.

    w3_rmdir('/www/domain.com/public_html/wp-content/cache/page_enhanced/www.domain.com/gratis');

    If anyone has a better idea of how to delete a custom file/directory, please let me know.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.