01/10/2014 at 5:25 pm
#276862
Keymaster
@ Paul
Hmmm, try this:
function cn_disable_output_cache( $cached ) {
if ( ! is_admin() ) return FALSE;
}
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' );
That should only affect the display on the frontend while allowing the update to work. The downside is the manage page in the admin will not show the change.
So maybe if you do this instead…
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');
That should remove the filters right before a save or update is done to an entry
