Created
March 3, 2014 08:29
-
-
Save keesiemeijer/9320762 to your computer and use it in GitHub Desktop.
WordPress: Checks if new post is created
This file contains 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 | |
/** | |
* Checks if post status is new | |
*/ | |
add_action( 'transition_post_status', 'post_unpublished', 10, 3 ); | |
function post_unpublished( $new_status, $old_status, $post ) { | |
if ( $old_status == 'new' ) { | |
// do stuff for new post | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment