Forum: F.A.Q

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support and general questions related to GEO my WP plugin and its core add-ons please use the support forum.

Using gmw_pt_update_location to set locations only works on manual refresh

Home Forums F.A.Q Using gmw_pt_update_location to set locations only works on manual refresh

This topic contains 2 replies, has 2 voices, and was last updated by  advertiseit 11 months, 4 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #49880

    aaahollister
    Participant

    I am building a system where a user can import a CSV file with over 1000 ‘Doctors’ and their addresses into WordPress using the All Import Pro plugin, the import creates a post for each Doctor and fills in various meta which includes their addresses, but unfortunately not Lat and Long values.

    I am trying to use the gmw_pt_update_location function to set the location of each of these posts automatically when the posts are created, using a combination of their street address, city, and country.

    The update function works if I go into one of the posts and then refresh the page, however I don’t seem to be able to get it to update the locations for all posts, and I’m really looking for something that can run on each post when it is created to update the location per post. I’ve tried various different hooks and I’ve also tried wrapping the below function in a WP_Query looping through all the posts too.

    Is there a way I can get this function to run, either when posts are created or in a bulk way after the import, and successfully set the locations for each post?

    Thanks,
    Adam H

    #49919

    aaahollister
    Participant

    Managed to figure it out, turned out to be using the wrong hook from the WP All Import Pro plugin. For anyone trying to achieve an integration like this between these two plugins, if you want your code to run on each post as it is being created from the CSV import, you need to use the gmw_pt_update_location function on the pmxi_saved_post action.

    Thanks for such a useful plugin!

    #58365

    advertiseit
    Participant

    Hi @aaahollister,

    Thanks for posting this. I know this is old but would you be able to post your corrected function. It would help immensely.

    Thanks,
    Jason

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Using gmw_pt_update_location to set locations only works on manual refresh’ is closed to new replies.