跳到内容

Advanced Custom Fields – Location Field add-on

v1.0

julienbechade · 2012年7月24日 上架

Adds a Location field to Advanced Custom Fields. This field allows you to find addresses and coordinates of a desired location.

正在使用
900+
评分
5.0 / 5
累计下载
5.1 万
最近更新
2017年11月29日
2 条评价需要 WordPress 3.4+已测试到 3.4.2

截图

Location field and its options
Location field and its options
Location field on an edit-post page
Location field on an edit-post page
Type in a partial address or some coordinates
Type in a partial address or some coordinates
Choose to get the complete address
Choose to get the complete address

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

Usage

Make sure you read the Advanced Custom Fields‘s documentation first.

Back-end

The Location field comes with 3 options:

  1. The map address let you choose the value(s) to return on the front-end:
    • Coordinates & address
    • Coordinates
  2. The map center let you set the coordinates used to center the initial blank map.
  3. 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’);

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums