[wp-hackers] BUG? Custom values not set early enough on publish?

Peter Westwood peter.westwood at ftwr.co.uk
Thu Aug 26 07:11:12 UTC 2010

On 26 Aug 2010, at 03:40, Alister Cameron wrote:

> Folks,
> I've hooked up a function to the "future_to_publish" hook.
> That function is essentially sending out an email when a new post is
> published in a particular category.
> However one interesting thing I've discovered...
> I need to add a custom value into the body of the email and I do this with a
> custom value.
> So my function calls the get_post_custom_values() function to retrieve the
> value I want, for insertion into that email.
> HOWEVER... as best I can tell, the custom value is not yet set at the point
> where the "future_to_publish" hook fires, and I'm getting no data returned
> from the call to get_post_custom_values().
> Is it possible that this is the case? That if you save custom values they're
> not correctly associated to the published post until AFTER the
> "future_to_publish" hook has fired?
> I've not got into it any deeper than this, but asking for help!
> Any ideas Westy??

Without seeing the code you are using which reproduces this issue not many :-(

Could you share a link to a cut down plugin which just illustrates the issue that will make it much easier for people to help

Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com
C53C F8FC 8796 8508 88D6 C950 54F4 5DCD A834 01C5

More information about the wp-hackers mailing list