Created
August 24, 2012 03:34
-
-
Save codearachnid/3445180 to your computer and use it in GitHub Desktop.
WordPress admin editor screen is new vs edit
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 | |
/** | |
* use in WordPress editor to determine if is in new|edit mode | |
* | |
* @return bool | |
*/ | |
function admin_is_new(){ | |
global $post; | |
return (get_post_status($post->ID) == 'auto-draft'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment