Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author 100plugins

    (@100plugins)

    Hello @ivitae,

    The locations are available via the WordPress REST API but just for reading.

    Best regards,
    Daniel

    Thread Starter ivitae

    (@ivitae)

    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

    (@100plugins)

    Hi @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

    (@ivitae)

    Thanks Daniel.

    Plugin Author 100plugins

    (@100plugins)

    Hi @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.