• Resolved John

    (@mav3000)


    Hi Eyal, I am updating the website I designed a year ago using Geo My WordPress. Since updating my plugins, the function gmw_pt_update_location() has stopped doing what it should.

    I have a user-submittable front-end form which passes an address field to the gmw_pt_update_location function like this:

    include_once( GMW_PT_PATH .'/includes/gmw-pt-update-location.php' );
    		if ( function_exists( 'gmw_pt_update_location' ) ) {
    
    			$args = array(
    				'post_id'         => $post_id,
    				'post_type'       => 'activity',
    				'post_title'      => get_the_title( $post_id ),
    				'address'         => get_post_meta( $post_id, 'wpcf-address', true),
    			);
    			gmw_pt_update_location( $args );
    		}

    The form submits without error, but GWP does not geolocate the address. It used to work, but now doesn’t.

    When I view the post in the WP Dashboard, the ‘Location’ column states ‘No location found’.

    When I enter an existing address into the form field, GWP does set the location and the address correctly – suggesting it can look up existing addresses from the DB but cannot geolocate new ones.

    I have a Google Maps API key entered into ‘GMW Settings’.

    Any idea why this isn’t working?

    Many thanks, Richard

    https://www.ads-software.com/plugins/geo-my-wp/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter John

    (@mav3000)

    Hi Eyal,

    I’ve traced this to an error when the code gets here:

    $geocoded_address = GEO_my_WP::geocoder( $address, $force_refresh );

    It seemed the geocoder is throwing an error for some reason, even though it has a valid address.

    Could this be to do with a Google Maps API? I’ve entered a ‘Server’ API into the GMW Settings Page, even though GMW says one isn’t needed.

    Thread Starter John

    (@mav3000)

    Hi Eyal,

    When looking at the browser console, I see this error – which appears with or without an api present in the GMW Settings page:

    Google Maps API error: UrlAuthenticationCommonError https://developers.google.com/maps/documentation/javascript/error-messages#url-authentication-common-error
    _.hb(a="Google Maps API error: U...entication-common-error")js?libr...r=3.5.2 (line 34)
    Thread Starter John

    (@mav3000)

    Hi Eyal, Don’t worry about this – I’ve sorted it myself.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘gmw_pt_update_location Not Geolocating Address’ is closed to new replies.