Title: API to create a marker
Last modified: June 20, 2024

---

# API to create a marker

 *  Resolved [ivitae](https://wordpress.org/support/users/ivitae/)
 * (@ivitae)
 * [2 years ago](https://wordpress.org/support/topic/api-to-create-a-marker/)
 * Is there an API that can be used to create new markers on the map via PHP code?

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

 *  Plugin Author [100plugins](https://wordpress.org/support/users/100plugins/)
 * (@100plugins)
 * [2 years ago](https://wordpress.org/support/topic/api-to-create-a-marker/#post-17840961)
 * Hello [@ivitae](https://wordpress.org/support/users/ivitae/),
 * The locations are available via the WordPress REST API but just for reading.
 * Best regards,
   Daniel
 *  Thread Starter [ivitae](https://wordpress.org/support/users/ivitae/)
 * (@ivitae)
 * [2 years ago](https://wordpress.org/support/topic/api-to-create-a-marker/#post-17842007)
 * Thanks Daniel.
 * A map location in my website is part of a wider object. The user should be able
   to add and edit these objects in a dedicated form, therefore I need some way 
   to add and update a location via code.
 * Is there no way to do that ?
 *  Plugin Author [100plugins](https://wordpress.org/support/users/100plugins/)
 * (@100plugins)
 * [2 years ago](https://wordpress.org/support/topic/api-to-create-a-marker/#post-17855952)
 * Hi [@ivitae](https://wordpress.org/support/users/ivitae/),
 * Unfortunately not. However you can try to program a custom solution. A good starting
   point would be the ajax_add_location_from_frontend() function in the BaseController.
   php.
 * This function handles the input coming from the “Add location” form.
 * Best regards,
   Daniel
 *  Thread Starter [ivitae](https://wordpress.org/support/users/ivitae/)
 * (@ivitae)
 * [2 years ago](https://wordpress.org/support/topic/api-to-create-a-marker/#post-17857544)
 * Thanks Daniel.
 *  Plugin Author [100plugins](https://wordpress.org/support/users/100plugins/)
 * (@100plugins)
 * [2 years ago](https://wordpress.org/support/topic/api-to-create-a-marker/#post-17859995)
 * Hi [@ivitae](https://wordpress.org/support/users/ivitae/),
 * here are some important infos if you want to create a script on your own that
   directly interacts with the WordPress database:
 * A location consists of these database entries:
    - **wp_posts** table: An entry of post_type _oum-location_
    - **wp_postmeta** table:
       * An entry with meta_key _\_oum\_location\_key_ containing a serialized object
         with details on the location
       * An entry with meta_key _\_oum\_location\_image_
       * An entry with meta_key _\_oum\_location\_audio_
 * I would recommend to inspect your database for an existing location to understand
   how location data is stored. After that it should be possible to write a custom
   script that created, updates or deletes locations.
 * Hope this helps, 
   Daniel

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

The topic ‘API to create a marker’ is closed to new replies.

 * ![](https://ps.w.org/open-user-map/assets/icon-256x256.png?rev=2779645)
 * [Open User Map – Interactive Leaflet Maps](https://wordpress.org/plugins/open-user-map/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/open-user-map/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/open-user-map/)
 * [Active Topics](https://wordpress.org/support/plugin/open-user-map/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/open-user-map/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/open-user-map/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [100plugins](https://wordpress.org/support/users/100plugins/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/api-to-create-a-marker/#post-17859995)
 * Status: resolved