Turns out it was an issue with not providing a geocode API! I needed to change
$geocode=file_get_contents('https://maps.google.com/maps/api/geocode/json?address=".$prepAddr."&sensor=false');
to
$geocode = file_get_contents('https://maps.google.com/maps/api/geocode/json?address=".$prepAddr."&key='.$api_key);
In other words, there needs to be the key parameter with the API key in that URL. I also removed the sensor parameter, as that does not appear to be needed.
Related Posts:
- How to update custom fields using the wp_insert_post() function?
- How to display multiple Post meta_key/meta_values by SQL query
- How to use multiple query with same meta key
- How can update custom meta for all posts
- Use ajax to update_post_meta
- how to increase custom post value by one most efficiently?
- How can I create a list of page titles from custom meta values?
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Is it possible to retrieve all posts with a certain value for metadata?
- Non-Closing PHP Query in WordPress Loop
- how to get serialized post meta
- WordPress loop by meta key that is an array? and how loop multiple arrays
- How to store multiple custom meta box
- Order a WP_Query by meta value where the value is an array
- Add a custom class to the body tag using custom fields
- Define category ID using get_post_meta
- Hide a div when a custom field is empty
- WordPress stripping out custom field tags
- Order category posts by last word of custom field
- Add a “custom field” to a category that can be retrieved when viewing the category page with get_post_meta
- How to update custom fields when post is published?
- WP post meta – for loop inside for loop
- When working with a post, almost all wp_postmeta are deleted
- If custom field doesn’t exist, or exists and it’s true show title?
- Metadata on the WP_Post object
- Get meta_id along with meta_key and meta_value
- Check if user already visited this post today
- Update all posts automatically when using post_meta
- How to make an meta_query optional?
- How to loop over custom fields in a page template?
- Compare two meta key values against each other inside the get_posts array?
- Unique key for each row in a repeater field
- Removing WordPress profile fields from non-admins
- Show custom field if it exists, and show different elements if it doesn’t
- Batch update a post meta field value of each post in Post Type
- Create a random unique 6 digit number as custom field for custom post type
- Custom field value not saving when it contains a URL?
- The text box have space character
- how to remove metadata from the posts of my blog?
- WordPress – Display array data of a child
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- Creating user status mode in WordPress
- Need Help Fixing My Iframes [closed]
- Need help with Google drive API [closed]
- Adding number to date not working [closed]
- Saving and Restoring a Canvas on A Individual User Basis
- How to use thumbnail size of image if I’m only using src to get image
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- Archive post by meta value + 24hours
- Trying to retrieve post meta
- Custom Field IF/ELSE PHP
- Remove the last X characters of a custom field value
- Advanced Custom Fields – display label and value only if value entered
- Why are the details of my todo not saving?
- Run str_replace on title and save the output to a custom field
- WordPress yoast seo plugin – parse snippet var in meta description
- if custom field doesn’t exist, use post thumbnail instead, as image background
- Handling repeater data
- How to add data to a custom field at the wp_users table?
- Using rules in Posts
- Update post meta – Custom field does not match meta-key
- Save the value of a wp_dropdown_pages
- Update value of a associative array with update_post_meta
- Front end file upload returning wrong attachment url
- Comparing Dates from custom field
- Adding custom url to readmore link using get_permalink()
- Display movies that apear this day next
- Add “alt” Attribute to GD Star Rating Tags
- custom header text
- Using a string from a custom field within a link
- Make separate text boxes for separate WordPress Custom Fields
- Add custom fields from different posts
- Delete images from media library when user deletes an image from ACF Gallery
- Display custom field value in woocommerce variable product via jQurey
- Block error message in foreach loop when looping through ACF field
- Where does php code to load data go?
- Hide author from search results meta, still display date and categories
- Fix common misspellings/errors based on array of replacements
- Unable to update the meta boxes with multiple fields
- Adding user meta to post meta wp_insert_post() not working
- How to use something like meta_query but for fields?
- Efficient way of querying for a “fallback” post?
- php if, else & custom fields – syntax error
- Order by in foreach
- retrieve wordpress post-meta using php not wordpress functions
- If Elseif Query
- Sorting Meta Fields?
- get_post_meta no longer working
- Display selected parts from selected pages on the frontpage?
- How to echo a different field if another field is empty?
- PHP Puzzle: Unique Styles with PHP loop
- Display custom meta box in my template file
- How to display the date under the post title?
- Advanced Custom Fields Show PHP in Text Areas
- WP query with variables gives no result for specific user
- Grabbing value of input field inside of array
- Convert custom field date format to “WordPress default”
- How to execute a shortcode within a custom field?