Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created June 3, 2015 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/0bad984d476cd328158a to your computer and use it in GitHub Desktop.
Save billerickson/0bad984d476cd328158a to your computer and use it in GitHub Desktop.
<?php
function be_purge_recent_post_cache( $new, $old, $post ) {
if( 'publish' == $new )
delete_transient( 'recent_posts_query_results' );
}
add_action( ‘transition_post_status’, ‘be_purge_recent_post_cache’, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment