how about hooking into em_event_save filter instead ?
$event = new EM_Event();
... // passing the data to $event
$aa = apply_filters('em_event_save', true, $event);
Do you mean something like that?
It is not working(i.e. now new event is created).
I also tried
$event->save();
with no result
Is the problem that your event info isn’t being saved or just that the permalink isn’t working?
The second. The permalink is not working.
Moreover, I am writting to the database in the tables I mentioned, and I can see my event in the category that I saved it, but I the link to the event is not working.
Also I cannot see it in the wp-admin as an event, but it appears in the category page when I search for it in my site.
To give some more info, I am doing inserts like:
INSERT INTO wp_posts (post_author,post_title,post_status,post_name,post_type,guid)
VALUES ('2', 'Basketball', 'publish', 'Basketball', 'event', 'http://mydomain/events/basketball' );
INSERT INTO wp_term_relationships (object_id,term_taxonomy_id)
VALUES ('156','6');
INSERT INTO wp_em_events (post_id,event_slug,event_owner,event_status,event_name,event_start_time,event_start_date,location_id)
VALUES ('156','Basketball','2','1','Basketball','00:00:00','2014-11-05','3');
with those I can see the event on the category basketball, but the link to it results to “Page not found”.
I will appriciate any help.
Thanks
If you take look at the wp_em_events table, do you see anything under event_slug for the events you’re saving?
I think that’s where it’s going wrong, the slug is either not being saved or is being saved incorrectly. In your example above, it should be basketball rather than Basketball, for example.
Did u solve this problem? I’m having the same issue.
I made a custom front-end form and save event/location data with wpdb.
I checked all data stored in below tables.
wp_posts
wp_em_events
Browse wp_em_locations
But it does not show up in back-end under events(or posts) and the event page(contains correct slug) goes to page not found. On the back-end tho, It counts the event I submitted with my custom form(All event number) but not displaying it on the page.
Please let me know if u did solve this problem.. thanks