I am creating my posts and POI custom fields through a PHP script (importing data from a CSV database).
I configured Mappress to create maps with POI custom fields, but I do not manage to have the map created automatically for each post when posts are created.
It only works if I manually go to each post admin panel and press “Update”. I tried with wp_update_post in my PHP script but do not manage to make it work.
Is there a workaround to have those maps created directly when I run my PHP script ?
I don’t know how your import script works, but MapPress hooks into the events for meta fields being updated in order to trigger its geocoding.
You might check to see if there’s a field ‘mappress_error’ on those posts, which would indicate a geocoding error, although you should still see an empty map.
You can also use the action ‘mappress_update_meta’ to force an update when you know all the field data has been saved – my own TurboCSV importer calls this action. You’ll need to pass it the post ID to update: