Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chrisgoddard/acf-address-map-field
A better map field for Advanced Custom Fields (includes address, phone, website, etc) - compatible version 4 & 5
https://github.com/chrisgoddard/acf-address-map-field
Last synced: 27 days ago
JSON representation
A better map field for Advanced Custom Fields (includes address, phone, website, etc) - compatible version 4 & 5
- Host: GitHub
- URL: https://github.com/chrisgoddard/acf-address-map-field
- Owner: chrisgoddard
- License: mit
- Archived: true
- Created: 2014-07-24T21:04:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-20T16:20:14.000Z (almost 8 years ago)
- Last Synced: 2024-08-03T17:10:28.398Z (4 months ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 56
- Watchers: 8
- Forks: 21
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-acf - Address/Map - A better map field for Advanced Custom Fields (includes address, phone, website, etc). (Third-Party Add-Ons)
README
Advanced Custom Fields: Address/Map Field
=====================*Please Note: I don't actively maintain this plugin*
I wanted a better map field for ACF - the native Google Map field only returns a single string for the name, which makes display and schema harder.
This field uses the same search functionality for the map, but will then populate name, phone, website, email, address (line 1/2), City, State, Zip, Country, Lat/Long, and Google Map url.
Those fields can be individually edited after the initial population from Google.
Here is the field UI:
![advanced custom field address google map field](http://boom.cgoddard.com/image/2N0r3z2h2320/Screen%20Shot%202014-07-24%20at%202.08.04%20PM.png)
get_field() output looks like:
```
[name] => Space Needle
[formatted_address] =>Space Needle
400 Broad St
Seattle,
WA
98109
United States
[address] => Array
(
[line_1] => 400 Broad St
[line_2] =>
[city] => Seattle
[state] => WA
[zip] => 98109
[country] => United States
)[info] => Array
(
[phone] => (206) 905-2100
[website] => http://www.spaceneedle.com/
[email] =>
[google_map] => https://plus.google.com/103084617480514911872/about?hl=en-US
)[position] => Array
(
[lat] => 47.620506
[lng] => -122.34927700000003
))
```
formatted_address is a schema markup of the address:
```
Space Needle
400 Broad St
Seattle,
WA
98109
United States
```WARNING: This field won't work with the_field(); - it's designed to return an array of data for a theme developer to use as they wish.