[wp-hackers] Handling Custom Meta Boxes

John Blackbourn johnbillion+wp at gmail.com
Tue Dec 15 00:26:04 UTC 2009


You might want to also check that the post isn't a revision, as IIRC
the save_post hook is fired twice for each save - once for the post
and once for the revision. wp_is_post_revision() and
wp_is_post_autosave() are handy functions for this.

John

On Mon, Dec 14, 2009 at 10:04 PM, scribu <scribu at gmail.com> wrote:
> Besides DOING_AUTOSAVE, also check for DOING_AJAX and DOING_CRON.
>
>
> On Mon, Dec 14, 2009 at 11:59 PM, Michael Pretty <mpretty at voceconnect.com>wrote:
>
>> I'm curious how most plugin developers handle saving settings from custom
>> post meta_boxes.  I've always handled this by adding an action to save the
>> result on 'save_post' and only updating if DOING_AUTOSAVE wasn't defined.
>>  The problem with doing this, is that the save_post action is also called
>> when a scheduled item is moved to published.  If this happens, the posted
>> values from the meta_box isn't available and I can't alway use isset since
>> that means I can never use checkboxes for input.
>>
>> Suggestions?
>>
>> Thank you.
>>
>> -Michael (prettyboymp)
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>
>
>
> --
> http://scribu.net
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list