Skip to content

Instantly share code, notes, and snippets.

@wpbullet
Created November 20, 2017 13:42
Show Gist options
  • Save wpbullet/65490743b3d2540b8f0beac120424f0d to your computer and use it in GitHub Desktop.
Save wpbullet/65490743b3d2540b8f0beac120424f0d to your computer and use it in GitHub Desktop.
/**
* Exclude certain post types from nginx cache cleanup by Till Kruss
*
*/
function nginx_cache_excluded_custom_post_types( $post_types ) {
$post_types[] = 'shop_order';
$post_types[] = 'shop_order_refund';
$post_types[] = 'shop_subscription';
$post_types[] = 'ticket';
$post_types[] = 'ticket_reply';
$post_types[] = 'ticket_history';
$post_types[] = 'ticket_log';
return $post_types;
}
add_filter( 'nginx_cache_excluded_post_types' , 'nginx_cache_excluded_custom_post_types' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment