What you want is possible, but it does require a bit of custom code.
You could use a form plugin like Ninja Forms of Gravity Forms and then use a filter from those plugins that runs after the form is submitted to insert the form data as a store location.
This will have to be custom coded, and I unfortunately don’t have any code snippets that I can share showing how to do this.
Any form plugin that has a filter that runs after it’s submitted should be fine, since it allows you to intercept the submitted data.
If you want to go down the road of custom coding it, then let me know, and I can point you in the right direction when it comes to creating the location.
-
This reply was modified 5 years, 8 months ago by Tijmen Smit.
Thanks for answering Tijmen,
I’ll definitely aim to create custom code to store the new store location into the database.
I would only need the field names, types etc documentation from you to ensure I’m saving everything correctly.
Thanks!
Diana.
Sorry for the late response.
You need to create a new store location with wp_insert_post ( for the wpsl_stores custom post type ), this will return an ID which you need to use with update_post_meta.
The meta fields itself you can get from this function.
If no coordinates are provided, then you can grab them by passing the address to this function which you then save as the wpsl_lat and wpsl_lng key in the meta field for the location.