Home › Forums › Calendar Products › Community Events › Geo my WP integration
- This topic has 4 replies, 2 voices, and was last updated 10 years, 2 months ago by
George.
-
AuthorPosts
-
February 8, 2016 at 10:17 am #1069628
James
ParticipantHi,
I want to integrate geo my WP with events calendar and the community events plugins. I’m thinking the easiest way is to take the event location information that the front end form already asks for, and add this to the database fields for geomywp.
Is there a hook I can use to do this after the form has been submitted?
Or is there a better way to integrate geo my wp with the community events plugin.
Thanks for any help,
JamesFebruary 8, 2016 at 11:36 am #1069681George
ParticipantHey James!
While we unfortunately don’t have any specific advice on integration with geomywp, there is indeed an action that is fired upon the creation of a Community Events submission.
The action is simply ‘tribe_community_event_created’, and includes the Event ID of the newly-created event as an argument in its callbacks. So to actually use this hook, you’d write some code like this:
add_action( 'tribe_community_event_created', 'tribe_example_for_james' );function tribe_example_for_james( $event_id ) {
echo $event_id; // echoes event ID...
}
Obviously you wouldn’t just “echo” the Event ID like in the above example function, but it’s just an example to show you all of the parts in place.
I hope that’s helpful and wish you the best of luck with your customizations. Please let me know if there’s anything else I can help with!
— George
February 10, 2016 at 3:58 am #1070611James
ParticipantThanks George, I’ll have a play with that and see what I can achieve. That should do the trick with a bit of database work.
Future integration with geomywp would be a great addition to a future release.
February 10, 2016 at 9:57 am #1070926James
ParticipantThanks, got it working.
For anyone that stumbles upon this I used a combination of the above action and http://docs.geomywp.com/gmw_pt_update_location/ to insert the location from events calendar, into the geomywp table. (I had to copy parts of the actual function from the plugin folder and adapt it to work for me).
February 10, 2016 at 11:24 pm #1071187George
ParticipantThank you for the update @James! I appreciate you sharing your solution.
Be sure to keep good backups of all custom code like this, if you’re not doing that already! 🙂
Best of luck with your project,
George -
AuthorPosts
- The topic ‘Geo my WP integration’ is closed to new replies.
