Automatic POI maps with custom fields

Home Forums MapPress Support Automatic POI maps with custom fields

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13380
    pat2pat
    Participant

    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 ?

    #13381
    Chris
    Keymaster

    Hi,

    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:

    do_action('mappress_update_meta', $post_id);

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.