add_filter(
'glm_members_add_link_to_event_list_entry',
function( $content ){
-
+
// Check if there's an existing reg_event record for the supplied event ID.
require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
$RegEvent = new GlmDataRegistrationsRegEvent($this->wpdb, $this->config);
-
+
// If we were passed a valid Event ID
$eventId = $content-0;
if ($eventId > 0) {
// Try to get get the registrations data for this event
$regEvent = $RegEvent->getEntry($eventId, 'event');
-
- // If we received valid registrations data for this event then it's already in registrations
+
+ // If we received valid registrations data for this event then it's already in registrations
if ($regEvent) {
-
+
// Return link title and URL for this event in registrations
- return array('title' => 'Registrations', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=dashboard&event=".$eventId);
-
+ return array('title' => 'Registrations', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-event®EventID=".$regEvent['id']);
+
}
-
+
}
-
+
// Since we must not have had a good event ID or didn't find the event in registrations, return title and url to add this event to registrations
- return array('title' => 'Add Registrations To Event', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=add&event=".$eventId);
+ return array('title' => 'Add Registrations To Event', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-event&option=add&event=".$eventId);
},
10,