This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // add to your theme's functions.php file | |
| // _post can be any custom post type as well. I.E. if you have a book post type it would be 'save_post_book' | |
| add_action( 'save_post_post', function( $post_ID, $post, $update ) { | |
| // if it is an update and not a new post, return early | |
| if ( $update ) return; | |
| // a new post was created, send an email out |