Comments (10)
from pods-gravity-forms.
Hi guys,
Thanks for your work on this.
I am developing a project where this will be very helpful, but I was hoping you could provide me a bit more guidance on where and how I would implement the above code.
I have a Gravity Form created to capture all the fields related to a new “B&B Visitor”, and I have created a “B&B Visitor” Custom Post Type in Pods with matching fields. I now need to connect them so that when my Gravity Form is submitted, it creates a “B&B Visitor” Custom Post with the information from the Gravity Form.
I understand some of what I am reading in your text above, but I am not clear on where I need to call the action, and where/how I need to define your_gf_mapping_config.
If you could give me an overview of how this would be implemented, and what code would go in which files, it would really be appreciated. You could assume the Gravity From in question is Form ID #1 and the fields in question are just fields #5 and #6 (which I want to map to the "fields first_name" and "last_name" in a new “B&B Visitor” Custom Post)
Thanks so much in advance.
from pods-gravity-forms.
Hi again. Just wondering if anyone has a status on this. I have not gotten far on my own so if a GUI will be forthcoming I will stop my attempts and just be patient. Thanks again for all the great work, a donation was sent earlier today.
from pods-gravity-forms.
I'll work on a reply for this tonight in my late night dev run.
from pods-gravity-forms.
Thanks Scott, much appreciated.
from pods-gravity-forms.
In your theme functions.php or in a plugin file, place the code example above and adjust as needed. Specifically:
add_action( 'gform_pre_process_{form_id}', 'your_gf_mapping_config' );
That's the type of thing needed here, which you'll probably only want to target if ( !is_admin() )
in your function.
/**
* Map submissions from a GF form to a Pod
*
* @param array $form GF Form array
*/
function github_greg_pods_to_gf( $form ) {
// Don't hook in the admin area, unless you need it
if ( is_admin() ) {
return;
}
$options = array(
'fields' => array(
'5' => 'first_name',
'6' => 'last_name'
)
);
$pods_gf = pods_gf( 'b_b_visitor', $form_id, $options );
}
add_action( 'gform_pre_process_1', 'github_greg_pods_to_gf' );
Please let me know how that works for you.
from pods-gravity-forms.
Thanks for taking the time Scott, you are too kind. I will let you know how it goes!
from pods-gravity-forms.
Thanks again for your help Scott.
Initially it didn't work (the gravity form submitted, but no pod post got created). However, I found that if I hard-coded the $form_id value within the pods_gf function call as follows...
function github_greg_pods_to_gf( $form ) {
...
$pods_gf = pods_gf( 'b_b_visitor', '6', $options );
}
add_action( 'gform_pre_process_6', 'github_greg_pods_to_gf' );
...then it would actually work and create the pod post, but would also return this PHP warning:
Warning: Invalid argument supplied for foreach() in /plugins/pods-gravity-forms-master/includes/Pods_GF.php on line 2878
Warning: Invalid argument supplied for foreach() in /plugins/pods-gravity-forms-master/includes/Pods_GF.php on line 1298
Perhaps it's a simple thing I am not seeing.
from pods-gravity-forms.
Fixed the warnings, they were the issue.
from pods-gravity-forms.
Once the pod item gets created from the gravityform entry, how would I get the ID of the pod item that was created?
$pods_gf->?
Thanks
from pods-gravity-forms.
Related Issues (20)
- Trying to save form gives WordPress Critical error HOT 3
- File upload "is empty" error on submit
- Cannot force new post to be published HOT 2
- "No selection" Text (--Select One--) is not displayed in GF in specific cases HOT 1
- Date Time display in UTC form instead of localtime HOT 2
- --Select One-- displaying in Pods linked Gravity Form field HOT 6
- Pods Gravity Form Not Saving HOT 1
- Pods Gravity Form Not Saving - Still open issue
- Issue with Pods GF add-on hooks for updating form entry
- Using pods-gravity-forms to create new PODs post corrupts taxonomy value HOT 1
- Number and Currency fields not showing HOT 1
- pods addon form settings UI is messed up in GF 2.5 HOT 1
- Two identical posts are generated at once with GF 2.5.x HOT 21
- Gravity Flow Form hangs when submitting user input during workflow process HOT 1
- Pods feed mapping UI is not rendering correctly HOT 2
- Limit list to the same Post Author in Relationship fields has no effect in GF
- Strange Issue HOT 1
- Image from Gravity Form is not saved in Pod Image using the Pods Gravity Form Add-on
- Copies of the image being uploaded to media library when the form entry is resubmitted
- Fatal Error using PHP8 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pods-gravity-forms.