Posting event with a gravity form.

This topic contains 30 replies, has 5 voices, and was last updated by  Stephen Harris 9 years, 11 months ago.

Viewing 15 posts - 16 through 30 (of 31 total)
  • Author
    Posts
  • #2954

    Mmm… odd. Feel free to pastebin with your updated code. eo_update_event() should work – its used to update the events from the admin side :). What is returned? Should be the post ID – but it could be an WP_Error.

    Stephen Harris
    #2959

    Pastebin

    Looking at the example at gravity here, it uses wp_update_post() so I can not see why eo_update_event() will not work. I don’t get any error the post is created but with out the event_details.
    Also if I create two of these posts with the pastebin code the second post does not show up in the events list (admin side) until I trash the first. Which is odd.

    If I let eo and gravity make a post each the gravity post is a lower number (ie 402) then the eo post (ie 404) so I know I have a post id.

    I can use eo_insert_event() and disable gravity from making the post and update all the post meta but then I lose the uploaded image being moved to the media library (re sized, set as featured) and this works well for me as I can easily remove attachments when events are deleted.

    Thank you for your time!

    Michael
    #2964

    Looking at your gist, looks like you have the arguments of eo_update_event() swapped. (Post ID first), but then the $event_data should be the second, and the $post_data should be third.

    Also, you update the title, content and status – that might not be necessary if Gravity Forms have already created the post (doesn’t harm to leave it in though).

    Stephen Harris
    #2965

    No go.
    I will try that code (a few posts back) to see if I can attach an image when using eo_insert_post().

    Michael
    #3319

    If you use Brad Vincent’s Gravity Forms + Custom Post Types plugin (http://themergency.com/plugins/gravity-forms-custom-post-types/) you can use GF’s Post title field to save as a custom post type. Then all you need to do is create custom fields (Date and Time) to fill in the post meta. What are the unique identifiers for the post meta in the meta box Event Details?

    Start Date/Time:
    End Date/Time:
    All day (Checked/unchecked):
    Reoccurence:
    Include/Exclude occurrences:
    Venue:

    Thanks! (:

    Matt
    #3323

    Hi Matt,

    I think all you need to use is eo_update_event() with the arguments there to save the event schedule meta and save the dates to the database.

    Stephen Harris
    #3334

    If you wanted to create a separate function in a child theme, I believe you are correct to use eo_update_event. For the amateurs and non-coders, gravity has this built in custom post type field to insert the values into your custom event post type (See Image). What would be the unique meta keys for each field?

    http://i.imgur.com/yFs8PkO.png

    iphoenix
    #3335

    Unfortunately it’s not that simple. The post meta simply contains scheduling meta data – but this is serialised -and in any case, the dates would still need to be generated and saved to the database table.

    However, I’ve been considering building an EO-Gravity Forms add-on that would make this easier. But, until then, the only way of doing it is to use eo_update_event() using the post ID passed to you from Gravity Forms.

    Stephen Harris
    #3344

    With the code I pasted in this post before I have no problems using gravity to submit events. BUT only using eo_insert_event() and using Gravity Form hook to disable it from creating the post. If I use eo_update_event() things do not work right. Like the dates are not added and if I post a second event it will not show up in the post list until I delete the first. But they do not show up on the front end as they have not date meta.

    I am even having luck setting up events that are not all day events (reoccurring).

    My only problem/wish is that I could get a featured image to work. I can not work out how to get the uploaded image into wp media when gravity does not make the post. If i try to use the image from gravity upload path it has a bunch of stuff at the end of the extention I’m unsure about ( ie: xyz.jpg|:|:| ).

    So it is not very hard to do but an add on would be cool to.

    Michael
    #3596

    Stephen please help me with this bit. I can set up all but weekly event recurrences.

    I have my weekly data (MO,TU etc) stored in $entry['43'] from check boxes on my GF. How do I set an array from the values in this variable to send to $schedulemeta?

    $schedulemeta = $entry['43'] ;

    I will add my full code after I get this bit done with hopes you’ll look it over for me and to share with others.

    Michael
    #3597

    After digging in the database to see how my $entry['43'] data is stored I see I have this $entry['43.1'] ,$entry['43.2'] etc for each of the values. So now I can add the data to the array but I get this “SASU” not “SA”,”SU”. I don’t know (yet) how to format the array right. Also How would I get something like this $entry['43.$s'] do deal with the [43.X] for my 7 days (is there a wildcard for the .X)?

    Michael
    #3598

    Ok worked it out. May not be pretty but…Thanks for letting me thing out loud.

    Michael
    #5555

    Hi Stephen,
    In which folder in wordpress I need to add your script from your site?

    Thank you so much for answer.

    Matej
    #5556

    Ok nevermind, I figured that out, but I have one more question – event is posted as a draft is here any way how to post it right to the web?

    Matej
    #10882

    Hi Stephen

    I am a big fan of your awesome plugin. It would be absolutely brilliant to offer fronted event posting with the functionality of gravity forms plugin. You wrote about an gravity form add-on a while ago? Are there any news?

    Thanks a lot for your info, Ben

    Benjamin Ogg
Viewing 15 posts - 16 through 30 (of 31 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.