[wp-testers] Post Hooks

Matthew Robinson mattyrobuk at googlemail.com
Thu Mar 6 20:14:37 GMT 2008


I'm updating my plugin for WordPress 2.5 and have found the  
add_meta_box feature. It looks like a great way to implement a feature  
I've been requested several times.

Basically my plugin (Subscribe2) sends notification emails when you  
make a new post on your blog. Using add_meta_box and I add a new  
Advance box to over-ride this sending on a per post basis but..

Which hook is the best for dealing with entering the data into the  
postmeta table?

My emails link to the transition hooks (like new_to_publish and  
draft_to_publish) so using edit_post, save_post and wp_insert_post may  
be too late in the process (if I'm reading the code right), but using  
transition_post_status doesn't help either because the user may have  
hit save once, then checked the box I've added and hit save again -  
this won't transition the post so won't call the function.

Is there a need for another hook or am I missing something obvious?

Thanks in advance,
Matt


More information about the wp-testers mailing list