Skip to content

Instantly share code, notes, and snippets.

View coltjones's full-sized avatar

Colt Jones coltjones

View GitHub Profile
@coltjones
coltjones / functions.php
Created October 29, 2014 22:56
Purge Facebooks cache for a newly published page/post in wordpress.
<?php
add_action( 'transition_post_status' , 'purge_future_post', 10, 3);
function purge_future_post( $new_status, $old_status, $post ) {
if($new_status == 'publish') {
purge_facebook_cache($post);
}
}
function purge_facebook_cache($post_id) {