Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Gabriel de Tassigny

    (@gdetassigny)

    Hi,

    I directly called:

    wp_cache_flush();

    and that seems to work fine.

    If you wanted to handle it using Object Cache Pro’s internal, you could do it this way too:

    	global $wp_object_cache;
    $wp_object_cache->flush();

    This implementation works, but it’s not ideal as it means the entire object cache is being flushed. Ideally I would prefer to be able to flush all related posts that got modified (I’m using the “Replace the file, use the new file name, and update all links” so I would need to call the clean_post_cache() function for each post that were modified). Is there a way to achieve this? I couldn’t find any hook within enable-media-replace plugin to be able to know which posts were modified

    Thread Starter Gabriel de Tassigny

    (@gdetassigny)

    Thanks for your response.

    After further investigation, this is related to the usage of object cache pro on our site. Adding an action to programmatically flush the cache when “emr/cache/flush” is triggered solved it.

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