Skip to content

Instantly share code, notes, and snippets.

@yalamber
Created May 30, 2013 12:45
Show Gist options
  • Save yalamber/5677577 to your computer and use it in GitHub Desktop.
Save yalamber/5677577 to your computer and use it in GitHub Desktop.
add_action('wp_insert_post', 'wpexpo_on_publish');
function wpexpo_on_publish($post_id){
if ( !wp_is_post_revision( $post_id ) ) {
$post_status = get_post_status($post_id);
if($post_status == 'publish' and (isset($_POST['original_publish']) and $_POST['original_publish'] == 'Publish')){
//codes here
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment