Events Manager
[resolved] How to add events externally (7 posts)

  1. courier_wp
    Posted 4 years 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.


  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 4 years ago #

    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)

  3. courier_wp
    Posted 4 years ago #

    Thanks Marcus, quick and easy ;)

  4. SpikeSpade
    Posted 4 years 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

  5. mahe84b
    Posted 4 years ago #

    Dear Spike am having the same issue. please advise if you are successful.

  6. SpikeSpade
    Posted 4 years ago #


    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

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 4 years ago #

    you can email support on wp-events-plugin.com

    would be interested to see how you did it

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic