Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This one is doing my head in! I'm using this code as the basis for one of my custom post types.

https://github.com/tammyhart/Reusable-Custom-WordPress-Meta-Boxes/blob/master/functions/real-estate.php

In my case I don't need the editor - I just want the user to complete the contents within the meta box.

When I adjust this line:

'supports' => array( 'title', 'editor', 'thumbnail' ),

to this instead

'supports' => array( 'title', 'thumbnail' ),

Everything works - except that for the fact that if I leave the page open and unedited for a short period of time I get the alert box prompting me that unsaved changes will not be saved. There are no changes being made to the post! Simply adding back in the 'editor' support fixes the issue but I don't want the editor.

I've also tried adding

    remove_post_type_support( 'mycustompost_type', 'editor' );

Just after the register_post_type call but the same issue persists.

I've read multiple threads about AUTOSAVE etc. which are all present in the generic functions file that comes with this code https://github.com/tammyhart/Reusable-Custom-WordPress-Meta-Boxes/blob/master/functions/meta_box.php

Has anyone any experience with this issue and how to resolve?

share|improve this question
    
Had you tried it without a plugin? It is hard to guess is it issue with plugin you are using, WP core or something entirely different in your install. –  Rarst Nov 17 '12 at 20:50
add comment

1 Answer

The auto-save that is running is searching for a field with name="post_content". I believe a quick fix to you're problem would be to add a hidden field like this:

<input type="hidden" name="post_content" value="" />

This might allow the auto-save to function by simply inserting an empty string for the post_content field of wp_posts table.

I have not had this issue before. But please try this out and tell me if it works for you.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.