Reply To: Use hook/custom endpoint after post creation – WS Form

My Account

Forums

Forums General Use hook/custom endpoint after post creation Reply To: Use hook/custom endpoint after post creation

#37099
cubetech
Participant

Okay looks like I found the solution by myself 🙂

Based on the example here https://wsform.com/knowledgebase/handling-submit-data-with-your-own-code/ I created a function which simply checks for existence of a custom property:

function SendNotifications($form, $submit) {
  if (property_exists($submit, 'post_id')) {
    $newlyCreatedPost = $submit->post_id;
  }
  return $submit;
}

If there is a post_id I can then do whatever I want with it 🙂