| 开发者 | justinkruit |
|---|---|
| 更新时间 | 2026年5月11日 04:56 |
| PHP版本: | 7.2 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
address_lookup_for_acf/register_providers action.get_field() or the_field() in your templates — the value is returned as an associative array.$address = get_field('my_address_field');
The returned array has the following structure:
[
'display_name' => 'Example Street 1, City, Country',
'coordinates' => ['lat' => '52.370216', 'lon' => '4.895168'],
'house_number' => '1',
'road' => 'Example Street',
'city' => 'City',
'state' => 'State',
'postcode' => '1234 AB',
'country' => 'Country',
]
Custom providers
You can register a custom address lookup provider by hooking into the jk_address_lookup_for_acf/register_providers action:
add_action('jk_address_lookup_for_acf/register_providers', function ($registry) {
$registry->register(new MyCustomProvider());
});
Your provider must extend justinkruit\AddressLookupForAcf\Providers\AbstractProvider and implement the name(), label(), and search() methods.
Filters
jk_address_lookup_for_acf/nominatim_url — Override the Nominatim API base URL (e.g. to use a self-hosted instance).jk_address_lookup_for_acf/nominatim_url_vars — Modify the query parameters sent to the Nominatim API.address-lookup-for-acf folder to the /wp-content/plugins/ directory.No. It works with both the free and PRO versions of Advanced Custom Fields.
Yes. Use the jk_address_lookup_for_acf/nominatim_url filter to point to your own instance:
add_filter('jk_address_lookup_for_acf/nominatim_url', function () {
return 'https://nominatim.example.com/search';
});
PHP 7.2 or higher is required.