I was having the problem with WordPress autosave not sending custom field data, and found this entry on SO:

Wordpress add_meta_box() weirdness

The approved answer works, but is it not just preventing any autosave from happening by returning early? Isn't the same as disabling autosave completely? If so, wouldn't it be better to do so in the proper way instead of letting it try to autosave just to prevent it?

The only exception I could see is if one checked for a post-type before checking for autosave so that you only disabled autosave for certain post types.

I'm going to be disabling autosave completely, but was wondering what you guys thought.

EDIT: I'm not having problems with the autosave anymore. This question is to discuss the merits of the solutions that I mentioned above.

Additionally, I can't see how this would be a feature of WordPress, and would assume that autosave should be changed to include all post data. No?

我遇到了WordPress自动保存不发送自定义字段数据的问题,并在SO上找到了这个条目: p >

Wordpress add_meta_box()奇怪 p> \ n

批准的答案有效,但它不仅仅是通过提前返回来防止任何自动保存发生吗? 是否完全禁用自动保存? 如果是这样,以正确的方式这样做是不是更好,而不是让它试图自动保存以防止它? p>

我能看到的唯一例外是如果检查一个 在检查自动保存之前的一个post-type,这样你只能为某些帖子类型禁用自动保存。 p>

我将完全禁用自动保存,但是想知道你们的想法。 p>

编辑:我不再遇到自动保存问题了。 这个问题是讨论我上面提到的解决方案的优点。 p>

此外,我看不出这将是WordPress的一个功能,并假设应该更改自动保存 包括所有发布数据。 不是吗? p> div>

 3 条回答