Skip to content

Instantly share code, notes, and snippets.

@Fitoussi
Fitoussi / gmwUpdateEventPostLocation.php
Created November 26, 2018 21:17
Sync the location from Events Manager plugin with GEO my WP plugin.
/*
This example integrates GEO my WP and Events Manager plugin.
The script will update GEO my WP database table with the location
entered in the Event form from the front-end and back-end.
Note that when using GEO my WP together with Event Manager plugin
you should disable the GMW Location section for the Events Edit Post page ( in the back-end )
since The usage of Google maps API by the to plugin causes a conflict.
*/
@jsit
jsit / wp-all-import-events-manager.php
Last active March 5, 2020 17:35
Allow WP All Import to create events with Events Manager
// Create a proper EM_Event object in the database when an event-type post is
// imported with WP All import
add_action('pmxi_saved_post', 'post_saved', 10, 1);
function post_saved($post_id) {
if (class_exists(EM_Event)) {
$event_post = get_post($post_id);
// Only create a new event entry if the imported post is of type event and
// there is not an existing event for this post
$existing_event = em_get_event($event_post->ID, 'post_id');