Home › Forums › Calendar Products › Events Calendar PRO › Integration with Gravity Forms?
- This topic has 64 replies, 15 voices, and was last updated 12 years, 3 months ago by Rob.
-
AuthorPosts
-
October 13, 2011 at 12:34 pm #9646ChristinaParticipant
I know you are working furiously on the new community events option, but since I can’t wait, I’d like to use Gravity forms to allow for event submission. Tom Bowen’s excellent tutorial no longer seems to work because it appears that the way he referenced date and time have changed. Any hints or clues on how to patch it back together?
October 13, 2011 at 1:12 pm #9647Shane PearlmanMemberHey Christina,
I’ll ask Tim or John to update it.
October 14, 2011 at 7:27 am #9684AndrewParticipant+1 for this please 🙂
October 15, 2011 at 1:03 pm #9728JohnMemberThe date and time stuff should still work, but the post type has changed between ECP 1.3 and ECP 2.0, so you may need to rebuild the form using the new custom post type. If that doesn’t work, then let me know.
October 17, 2011 at 6:18 am #9789ChristinaParticipantShouldn’t the custom post type still be “Events”, or is it something else?
October 18, 2011 at 9:41 am #9829JohnMemberYes, it is, but internally the post type name has changed which is why I think that redoing the form should hopefully fix it.
October 18, 2011 at 10:36 am #9837ChristinaParticipantI rebuilt from scratch and it isn’t working for me. I’m getting the title and description correctly. When I test the form it is being correctly added as a draft in the “Events” category. But none of the other data (date, time, venue…) is persisting.
I’ll be the first to admit I’m no programming genius, so if anyone on the support forum gets this working, I’d love to know about it. I need this functionality to work for a site that is going live in the next two weeks.
Or maybe, just maybe, I’ll get super lucky and the Community Events Plugin will be ready within two weeks 🙂
October 18, 2011 at 10:40 am #9839RobMemberThanks for confirming, Christina. John is going to take another look at this and should be in touch here shortly.
October 26, 2011 at 2:48 pm #10189Shane PearlmanMemberHey Christina,
John poked at it today and noticed that the issue had to do with some new security measures we put in based upon the recommendations of the core team. John said he could update the tutorial to provide a new approach and is working on it. We’ll let you know as soon as he has a working solution.
October 26, 2011 at 4:18 pm #10194RobMemberHi folks. It looks I spoke with John about this today and it looks like you can get Tim’s original tutorial working by adding this code to the functions.php file:
add_action(‘save_post’, ‘save_tec_event_meta_from_gravity’, 11, 2);
function save_tec_event_meta_from_gravity($postId, $post) {
if( class_exists(‘TribeEvents’) ) {
// only continue if it’s an event post
if ( $post->post_type != TribeEvents::POSTTYPE || defined(‘DOING_AJAX’) ) {
return;
}
// don’t do anything on autosave or auto-draft either or massupdates
if ( wp_is_post_autosave( $postId ) || $post->post_status ‘auto-draft’ || isset($_GET[‘bulk_edit’]) || $_REQUEST[‘action’] ‘inline-save’ ) {
return;
}
if( class_exists(‘TribeEventsAPI’) ) {
TribeEventsAPI::saveEventMeta($postId, $_POST, $post);
}
}
}If anyone has any problems with this or find it non-functional (we tested today and it worked without issue), please let me know.
October 26, 2011 at 5:27 pm #10222RobMemberOr, for those interested in seeing it in a more structured format: https://theeventscalendar.com/event-submissions-using-gravity-forms-in-2-0/.
October 26, 2011 at 9:27 pm #10225BrianParticipantAwesome, thanks for this Rob. Attempting to do this integration with GFORMS right now
October 26, 2011 at 9:52 pm #10226BrianParticipantGot an error,
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in functions.php on line 149
There’s a problem somewhere in this line:
if ( wp_is_post_autosave( $postId ) || $post->post_status ‘auto-draft’ || isset($_GET[‘bulk_edit’])
Any idea? Is there a typo in there somewhere
October 27, 2011 at 6:47 am #10231BrianParticipantHere is the correct code (did you really try test this?! haha – two equals signs were missing, could not have worked, crashes site)
add_action(‘save_post’, ‘save_tec_event_meta_from_gravity’, 11, 2);
function save_tec_event_meta_from_gravity($postId, $post) {
if( class_exists(‘TribeEvents’) ) {
// only continue if it’s an event post
if ( $post->post_type != TribeEvents::POSTTYPE || defined(‘DOING_AJAX’) ) {
return;
}
// don’t do anything on autosave or auto-draft either or massupdates
if ( wp_is_post_autosave( $postId ) || $post->post_status == ‘auto-draft’ || isset($_GET[‘bulk_edit’]) || $_REQUEST[‘action’] == ‘inline-save’ ) {
return;
}
if( class_exists(‘TribeEventsAPI’) ) {
TribeEventsAPI::saveEventMeta($postId, $_POST, $post);
}
}
}October 27, 2011 at 7:01 am #10232BrianParticipantForm is working, event post is created when I submit the form….and title, body, start time and end time are being saved…..but Venue details are not. I have fields like “Venue Name”, “Venue Address”, “Venue City”, and “Venue Zip Code”.
Using _EventVenue as the custom field name , _EventCity and so on…isn’t working , and the data isn’t being saved along with the other event data. It is submitting to the form though in Gforms.
Any ideas?
I’m using the code from this tut http://creativeslice.com/tutorials/gravity-forms-events-calendar-submissions/ along with the code I pasted above in my functions.php file.
-
AuthorPosts
- The topic ‘Integration with Gravity Forms?’ is closed to new replies.