WordPress.org

Ready to get started?Download WordPress

Forums

autosave custom postmeta fields (1 post)

  1. gmisura
    Member
    Posted 2 years ago #

    1. I want to enable autosave for my custom postmeta fields.
    2. onbeforeunload always thinks my content is dirty (not equal to the last autosave).

    All searches lead to this:

    if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { return $post->ID; }

    which I've done already. more details: http://techwithketan.wordpress.com/2011/04/14/auto-save-problem-for-custom-variables/

    By default, autosave.js only looks at title+content.

    if ( ( title || content ) && title + content != autosaveLast ) return autosaveL10n.saveAlert;

    I've removed the content and i'm left with title and my postmeta fields in my meta box.

    My register_post_type does not have the "supports" 'editor' so tinyMCE should be disabled.
    I've also disabled it in my profile.

    Any built in way to do this?
    Or should be de-register the autosave script and admin_enqueue_script mine?

Topic Closed

This topic has been closed to new replies.

About this Topic