Skip to content

Instantly share code, notes, and snippets.

@sethrubenstein
Created August 18, 2014 15:42
Show Gist options
  • Save sethrubenstein/2abe3b3237c8b812f298 to your computer and use it in GitHub Desktop.
Save sethrubenstein/2abe3b3237c8b812f298 to your computer and use it in GitHub Desktop.
The proper way on publish_post hook to ensure your function is only running once on the actual publishing
$_POST['post_status'] == 'publish' && $_POST['original_post_status'] != 'publish'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment