Descrizione
This is an add-on for the Advanced Custom Fields
WordPress plugin and will not provide any functionality to WordPress unless Advanced Custom Fields is installed
and activated.
The Location field provides:
- a search field where you can type in some coordinates or an address and hit
Enter
. - a Google map which you can click at the desired location.
In both cases, Google will find the location and return the coordinates and the complete address, if you want it complete. A marker will be added at the desired location.
Source Repository on GitHub
https://github.com/julienbechade/acf-location-field
Bugs, Questions or Suggestions
https://github.com/julienbechade/acf-location-field/issues
Utilizzo
Make sure you read the Advanced Custom Fields‘s documentation first.
Back-end
The Location field comes with 3 options:
- The map address let you choose the value(s) to return on the front-end:
- Coordinates & address
- Coordinates
- The map center let you set the coordinates used to center the initial blank map.
- The map zoom.
Front-end
Retrieving the value(s) on the front-end differs according to the Map address options.
- Coordinates & address
$location = get_field(‘location’); echo $location[‘address’]; echo $location[‘coordinates’]; - Coordinates
the_field(‘location’);
Screenshot
Installazione
The Location Field plugin can be used as a WordPress plugin or included in other plugins or themes.
There is no need to call the Advanced Custom Fields register_field()
method for this field.
- WordPress plugin
- Download the plugin and extract it to
/wp-content/plugins/
directory. - Activate the plugin through the
Plugins
menu in WordPress.
- Download the plugin and extract it to
- Added to Theme or Plugin
- Download the plugin and extract it to your theme or plugin directory.
- Include the
location-field.php
file in you theme’sfunctions.php
or plugin file.
include_once( rtrim( dirname( FILE ), ‘/’ ) . ‘/acf-location-field/location-field.php’ );
FAQ
- Installation Instructions
-
The Location Field plugin can be used as a WordPress plugin or included in other plugins or themes.
There is no need to call the Advanced Custom Fieldsregister_field()
method for this field.- WordPress plugin
- Download the plugin and extract it to
/wp-content/plugins/
directory. - Activate the plugin through the
Plugins
menu in WordPress.
- Download the plugin and extract it to
- Added to Theme or Plugin
- Download the plugin and extract it to your theme or plugin directory.
- Include the
location-field.php
file in you theme’sfunctions.php
or plugin file.
include_once( rtrim( dirname( FILE ), ‘/’ ) . ‘/acf-location-field/location-field.php’ );
- WordPress plugin
- I’ve activated the plugin, but nothing happens!
-
Make sure you have Advanced Custom Fields installed and
activated. This is not a standalone plugin for WordPress, it only adds additional functionality to Advanced Custom Fields.
Recensioni
Non ci sono recensioni per questo plugin.
Contributi e sviluppo
“Advanced Custom Fields – Location Field add-on” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.
CollaboratoriTraduci “Advanced Custom Fields – Location Field add-on” nella tua lingua.
Ti interessa lo sviluppo?
Esplora il codice segui il repository SVN, segui il log delle modifiche tramite RSS.
Changelog
1.0
- Initial release