Fiddling around with a custom post type which is quite heavy modified. Started doing some testing to see if I had broken some function, and realized that wordpress doesn't have a function that checks if a post has any content at all. Meaning, if I press "Add new" and just press publish, it won't say a word just save the information in the database.
The problem is that it's not visible in the admin area, just in the database. An entry with the title Auto Draft and post status auto-draft is created.
This isn't the worlds biggest problem, but still I want to avoid to be creating unnecessary entries in the database.
So I wonder how I would go about to create some sort of function that checks if any data has been entered in the editor, and if it's blank it'll prompt the user to enter data before saving/publishing the post.
The publish meta looks like this:
<?php
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
<?php submit_button( __( 'Create' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) );
} else { ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Save') ?>" />
<input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Save') ?>" />
<?php } ?>