Title: Add Event through API
Last modified: August 21, 2016

---

# Add Event through API

 *  Resolved [Eugene](https://wordpress.org/support/users/euge_g/)
 * (@euge_g)
 * [12 years ago](https://wordpress.org/support/topic/add-event-through-api/)
 * Hi,
 * I need to be able to add events programmatically. Is there an API or function
   I can use to add an event directly in PHP?
 * Thanks,
    Eugene
 * [https://wordpress.org/plugins/events-manager/](https://wordpress.org/plugins/events-manager/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [12 years ago](https://wordpress.org/support/topic/add-event-through-api/#post-4829064)
 * try to hook into em_event_save filter – [http://wp-events-plugin.com/tutorials/saving-custom-event-information/](http://wp-events-plugin.com/tutorials/saving-custom-event-information/)
 *  Thread Starter [Eugene](https://wordpress.org/support/users/euge_g/)
 * (@euge_g)
 * [12 years ago](https://wordpress.org/support/topic/add-event-through-api/#post-4829100)
 * Thanks for the response.
 * Actually, the EM_Event class is all I might need. I don’t need to add custom 
   event information, only create an EM Event. Would something like this work? (
   I don’t have access to test right now.)
 *     ```
       $em_event = new EM_Event();
       $em_event->post_title = 'My New Post';
       $em_event->post_content_filtered = 'My post content';
       ...
       $em_event->save();
       ```
   
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [12 years ago](https://wordpress.org/support/topic/add-event-through-api/#post-4829143)
 * If you’re looking to create entirely new events outside of the admin area, you
   might want to look at /classes/em-event-post-admin.php to see how new events 
   are generated there.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add Event through API’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/add-event-through-api/#post-4829143)
 * Status: resolved