PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

What hook / filter should I use?

  1. I'm using GravityForms to create a post when a form is submitted, and using custom fields for it.

    I need to find a hook or action to use that runs /after/ the post is created (in forms_model.php @ public static function create_post($form, &$lead) ) -- AND the add_meta_value() calls all finish running. I had been trying off publish_post -- but that's a no-starter, as it runs before the custom fields are inserted!

    Is there some 'cleanup' hook that I could tag onto? Ideally before headers are sent, but either way would be fine at this point.

    Posted 12 years ago on Tuesday January 10, 2012 | Permalink
  2. I would just tie onto the same hook that the form catcher uses, but at a lower priority, except that if the form redirects after accepting the submission -- I believe the catcher would just redirect and die, so my code would never actually happen.

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink
  3. I've forwarded your request to the developers.

    Does the gform_after_submission hook allow you to do what you want? The post and entry have already been created at that point, but I might be unclear on exactly what makes this hook not appropriate in your case. Thanks.

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink
  4. Nope, no reason whatsoever. That works perfectly. I just was running backtraces in the code and couldn't find it.

    Thanks!

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink
  5. Great. Here I thought it might be more difficult than that and was ready to learn! Thanks for the update.

    Posted 12 years ago on Wednesday January 11, 2012 | Permalink

This topic has been resolved and has been closed to new replies.