courier_wp
Member
Posted 1 year ago #
Hi, I'm really excited implementing EM in my project, but I need to post events using a remote php script (in same server but outside wordpress, with external data)...
Actually Im using wp_insert_post function with success, but I think it needs to be "suplemented" passing an entire $EM_EVENT too, (or maybe bypassing EM functions and updating on DB directly?)
Any ideas?
Thanks a lot.
http://wordpress.org/extend/plugins/events-manager/
yes, I'd use the $EM_Events::save() function rather than wp_insert_post, it'll take care of the various db tables for you.
see how we do it public-side in em-actions.php, but you'll need to copy that and remove the wp_nonce checks (and make your own check so it's not open to spam)
courier_wp
Member
Posted 1 year ago #
Thanks Marcus, quick and easy ;)
SpikeSpade
Member
Posted 1 year ago #
Hey courier_wp,
I'm trying to do the same, but I'm having troubles filling the $EM_Event object correctly to be able to save.
Could you share your remote php script? Then I might be able to use it to make my CSV import
mahe84b
Member
Posted 10 months ago #
Dear Spike am having the same issue. please advise if you are successful.
SpikeSpade
Member
Posted 10 months ago #
Hey,
I haven't fixed it entirely, but I made an import which can import everything for the first time. (running it a second time, made duplicates, since I didn't check on existing events)
I could send you my script if you give me your email.
I printed the $EM_Event object right before saving and just rebuild that one.
After the $EM_Event->save(), I had to set a could of tem_relationsships with custom queries
you can email support on wp-events-plugin.com
would be interested to see how you did it