Giter Site home page Giter Site logo

Comments (5)

GitHubGreg avatar GitHubGreg commented on May 30, 2024

Just an update that I achieved the desired functionality by using this:

add_action("gform_after_submission_1", "my_after_submit_function", 10, 2);

to run this:

pods_api()->save_pod_item($params);

after the form submission.

Thanks again for the great tool.

from pods-gravity-forms.

schutzsmith avatar schutzsmith commented on May 30, 2024

@GitHubGreg So does this allow to submit more than two ACTs? And what is the whole code you used exactly in your functions.php?

from pods-gravity-forms.

schutzsmith avatar schutzsmith commented on May 30, 2024

@naomicbush Any ideas on how to make this happen? Submitting a gravity for to more than one Pod?

from pods-gravity-forms.

GitHubGreg avatar GitHubGreg commented on May 30, 2024

Hi @schutzsmith. As per my previous post, I was able to create two pod items through one gravityform submission by using the Gform_after_submission hook (explained here http://www.gravityhelp.com/documentation/page/Gform_after_submission).

Here is the code:

function after_customer_submit($entry, $form){

   //Create new 'Customer' Pod item
   $params = array(
       'pod' => 'customer',
       'is_new_item' => 'true',
       'bypass_helpers' => 'true',
       'data' => array(
           'first_name' => $first_name,
           'last_name' => $last_name,
       ),
   );
   $the_created_customer_id = pods_api()->save_pod_item($params);

   //Create new 'Pet' Pod item
   $params = array(
       'pod' => 'pet',
       'is_new_item' => 'true',
       'bypass_helpers' => 'true',
       'data' => array(
           'pet_name' => $pet_name,
       ),
   );
   $the_created_pet_id = pods_api()->save_pod_item($params);

}
add_action("gform_after_submission_1", "after_customer_submit", 10, 2);

In the above function I created two pod items (customer and pet) but you can create however many pod items within the function based on whatever gravityform fields you want.

Hope this helps.

from pods-gravity-forms.

schutzsmith avatar schutzsmith commented on May 30, 2024

@GitHubGreg awesome! I'll try that! Thank you so much

from pods-gravity-forms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.