@ Steve
re: Perhaps you wouldn’t want to make this info public
Nope, no harm in this being public. The caches are stored in the main {wpdb_prefix}_connections table as serialized arrays.
re: So now you are saying we CAN’T disable it? Or are you saying that even if we disable it now, if we re-enable it later the old cached items will re-appear?
Below is the code that will disable the caches. Like I said, disabling the cache will have a performance impact due to the increased number of db queries that will be required.
Using this code you will bypass the caches… as soon as you remove the code, the caches will be used which means the old data be shown. NOTE: Even with the caches disabled, when you add/edit an entry the caches will be kept in sync. This only disable the caches when displaying the entries.
function cn_disable_output_cache( $cached ) {
return FALSE;
}
function cn_enable_output_cache() {
remove_filter( 'cn_address_cached', 'cn_disable_output_cache' );
remove_filter( 'cn_phone_cached', 'cn_disable_output_cache' );
remove_filter( 'cn_email_cached', 'cn_disable_output_cache' );
remove_filter( 'cn_messenger_cached', 'cn_disable_output_cache' );
remove_filter( 'cn_social_network_cached', 'cn_disable_output_cache' );
remove_filter( 'cn_link_cached', 'cn_disable_output_cache' );
remove_filter( 'cn_date_cached', 'cn_disable_output_cache' );
}
add_filter( 'cn_address_cached', 'cn_disable_output_cache' );
add_filter( 'cn_phone_cached', 'cn_disable_output_cache' );
add_filter( 'cn_email_cached', 'cn_disable_output_cache' );
add_filter( 'cn_messenger_cached', 'cn_disable_output_cache' );
add_filter( 'cn_social_network_cached', 'cn_disable_output_cache' );
add_filter( 'cn_link_cached', 'cn_disable_output_cache' );
add_filter( 'cn_date_cached', 'cn_disable_output_cache' );
add_action( 'cn_update-entry', 'cn_enable_output_cache');
add_action( 'cn_save-entry', 'cn_enable_output_cache');
TIP: you can use the Code Snippets plugin to add this code to your site having the ability to turn it on and off as needed with a click of a link. It is a plugin I highly recommend.
Hope this clears up a bit of the confusion!
