Skip to content

Instantly share code, notes, and snippets.

@will0
Created April 8, 2014 02:57
Show Gist options
  • Save will0/10085661 to your computer and use it in GitHub Desktop.
Save will0/10085661 to your computer and use it in GitHub Desktop.
acf cache workaround
<?php
call_user_func(function(){
$purge = function ($post_id) {
if ('acf' === get_post_type($post_id) && !wp_is_post_revision($post_id)) {
wp_cache_delete('field_groups', 'acf');
}
return $post_id;
};
foreach (array('save_post') as $hook) {
add_action($hook, $purge, 999);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment