WP Manifestindependent plugin directory
manifest / content / acf-better-address-field

Advanced Custom Fields: ACF Address Map

Full Address field with geo-coded map. Compatible ACF 5 Only

★ 0stars
79release downloads
v0.1.0latest · 5 years ago

Install

Download ACF-Better-Address-Field-master.zip From the v0.1.0 release on GitHub, Apr 19, 2021

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/mindsharelabs/acf-better-address-field/releases/download/v0.1.0/ACF-Better-Address-Field-master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

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

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:

<div itemscope="" itemtype="http://schema.org/PostalAddress">
 <span itemprop="name">Space Needle</span>
 <span itemprop="streetAddress">400 Broad St</span>
 <span itemprop="addressLocality">Seattle</span>,
 <span itemprop="addressRegion">WA</span>
 <span itemprop="postalCode">98109</span>
 <span itemprop="addressCountry">United States</span>
</div>

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.

Releases

1 release. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v0.1.0 latest
Apr 19, 2021 5 years ago
ACF-Better-Address-Field-master.zip
79