wp-rocket-helpers
wp-rocket-helpers copied to clipboard
WP Rocket clears whole cache when ACF option page is updated despite the plugin "WP Rocket | Disable Cache Clearing" is active
Hi,
everything is described in the title.
Is this bug or oversight?
I use "WP Rocket | Disable Cache Clearing" and i thought that nothing can't clear cache except manual trigger by button or custom function.
Ok,
i've fount it in
/inc/3rd-party/plugins/advanced-custom-fields.php
function rocket_clear_cache_on_acf_options_save( $post_id ) {
if ( 'options' === $post_id ) {
rocket_clean_domain();
}
}
add_action( 'acf/save_post', 'rocket_clear_cache_on_acf_options_save' );
Could you adjust in to obey the "WP Rocket | Disable Cache Clearing" ?
Hello @przestrzal and thanks for creating the issue. I moved it to the correct repository.
Could you share with us exact steps to reproduce when the cache is cleared? Do you need premium version of the ACF plugin?
Hello, i found this solution is not perfect but is working fine !
add_action( 'acf/save_post', function () { define( 'WP_IMPORTING', true ); }, PHP_INT_MIN );