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 ?
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
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