[wp-hackers] save_post action done twice
sbressler at gmail.com
Fri Oct 22 10:52:40 UTC 2010
Ah, I see, one is a of type 'revision' and the other of type 'post'. Thanks!
Is save_post better than edit_post? What cases would edit_post miss?
On Fri, Oct 22, 2010 at 3:50 AM, scribu <mail at scribu.net> wrote:
> On Fri, Oct 22, 2010 at 1:28 PM, Scott Bressler <sbressler at gmail.com>
> > It seems that in hooking into the save_post action for saving the data in
> > custom meta-box, my callback is being called twice when either saving a
> > draft post or updating a published post. If I instead hook into
> > my callback is only called once.
> > Is this "double-calling" behavior with save_post expected? Should I be
> > hooking into edit_post instead?
> Yes, it's expected. You should be checking the post_type at the beginning
> your callback.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers